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

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -