Menu
Home
Recent Posts
Encoding URL with JavaScript
1:50 PM
0
Share
Check out the built-in function
encodeURIComponent(str)
and
encodeURI(str)
, this should work:
var
myOtherUrl
=
"http://example.com/index.html?url="
+
encodeURIComponent
(
myUrl
);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Development and programming answers
Search articles
Popular Posts
How to: Transact MySQL and PHP
The idea I generally use when working with transactions looks like this (semi-pseudo-code): try { // First of all, let's begin a...
How to: Calculate the difference between 2 dates in PHP
Input: Start Date : 2007 - 03 - 24 End Date : 2009 - 06 - 26 Output: 2 years , 3 months and 2 days Use strtotime() to conve...
PHP: Check if string contains specific word
You can use the strpos function which is used to find the occurrence of one string inside other: if ( strpos ( $a , 'are' ) !== ...
How to: Perform an AJAX Synchronous request
From the Jquery docs : you specify the async option to be false to get a synchronous Ajax request. Then your callback can set some data befo...
How to solve Undefined variable: _SESSION PHP
If you have this error then you must to call to session_start in the begining (at the top) of each php file where you want to use session...
No comments:
Post a Comment