Guest User

Loopback jQuery AJAX Request

a guest
Feb 28th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  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. };
Add Comment
Please, Sign In to add comment