SHARE
TWEET

Loopback jQuery AJAX Request

a guest Feb 28th, 2012 22 Never
  1. http://www.mydomain.com/some/subdir/file.php
  2.        
  3. $.post('/some/subdir/file.php', ...);
  4.        
  5. /**
  6.  * Retrieves the current root URL.
  7.  *
  8.  * @return string the root URL
  9.  */
  10. $.fn.rootUrl = function() {
  11.         var url = location.href;
  12.         return url.substring(0, url.indexOf('/', 7));
  13. };
RAW Paste Data
Top