ajax jquery - why this extra slash? -


I often see the code where AJAX files are being contacted ( somefile.php In the example below), it may be / before /

, to preserve the structure. Www.example.com/somefile.php Or to avoid security reasons? If this is the latter, then an explanation will also help.

  $ Post ('/ somefile.php', {id: id, val: val}, function (data) {if (some) {do something} second {do something else}});  

Thanks.

This indicates the root of the site, in links or images, just like every URL.
For example, if you are on http://example.com/sub/site.html , then somefile.php http://example.com/ Sub / somefile.php , while /somefile.php goes to the http: // example. Com / somefile.php


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -