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
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 solve: Fatal error: Allowed memory size of XXX bytes exhausted (tried to allocate XXX bytes)
There is not enough memory to run your script. PHP has reached the memory limit and stops executing it. This error is fatal, the script sto...
How to: Use json_encode in MySQL results
$sth = mysql_query ( "SELECT ..." ); $rows = array (); while ( $r = mysql_fetch_assoc ( $sth )) { $rows [] = $r ; } ...
How to: Preview an image before upload with jQuery
JavaScript function readURL ( input ) { if ( input . files && input . files [ 0 ]) { var reader = new FileR...
How to: Properly set up a PDO Connection
The goal As I see it, your aim in this case is twofold: create and maintain a single/reusable connection per database make sure that t...
No comments:
Post a Comment