Posted By

joe-bbb on 09/11/09


Tagged

object baseurl


Versions (?)

settings object containing base_url


 / Published in: JavaScript
 

  1. function get_settings() {
  2. var doc_location = document.location.href;
  3. var url_strip = new RegExp("http:\/\/.*\/");
  4. var base_url = url_strip.exec(doc_location);
  5.  
  6. var settings = { "base_url" : base_url }
  7.  
  8. return settings;
  9. }
  10.  
  11. function (){
  12. settings = get_settings();
  13. $(function(){
  14. console.log(settings.base_url);
  15. });
  16. }

Report this snippet  

You need to login to post a comment.