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: Create, edit and delete crontab jobs
Crontab usage: crontab [-u user] file crontab [-u user] [ -e | -l | -r ] (default operation is replace, per 1003....
How to: Get thumbnail from YouTube video API from PHP and cURL
Each YouTube video has 4 generated images. They are predictably formatted as follows: http : //img.youtube.com/vi/<insert-youtube-video...
How to: convert one date format to another (PHP)
The second parameter to date() needs to be a proper timestamp (seconds since January 1, 1970). You are passing a string, which date() ca...
How to solve: Notice: Uninitialized string offset: X
Such errors occur, when you are most likely trying to iterate over a non-existing character as shown in the example below. Consider you...
How to: Convert HTML form data to JavaScript Object using jQuery
serializeArray already does exactly that, you just need to massage the data into your required format: $ . fn . serializeObject = funct...
No comments:
Post a Comment