/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function get_settings() { var doc_location = document.location.href; var url_strip = new RegExp("http:\/\/.*\/"); var base_url = url_strip.exec(doc_location); var settings = { "base_url" : base_url } return settings; } function (){ settings = get_settings(); $(function(){ console.log(settings.base_url); }); }
Comments
