jquery "load" for path contain spaces - Need help !

You can "encodeURIComponent" your url:

$("#content").load(encodeURIComponent("uploads/flashes/New folder/target.php"));

Javascript encodeURIComponent method is equivalent to URLEncode.


You can use %20 to represent a space.

$("#content").load("uploads/flashes/New%20folder/target.php");

http://www.w3schools.com/TAGS/ref_urlencode.asp


EDIT:

If you don't want to do it manually, you could use encodeURI() instead. There are a number of common URI characters that it does not encode, which escape() will.

Tags:

Jquery

Load