I am experiencing some issue when loading some javascript file. I am using some jquery plugin and to make it work, I had to add the several required javascript files just before the closing body tag. Now I want these files to be loaded for some specific url, so I tried this
$(document).ready(function(){
if(window.location.href.indexOf("some url") > -1) {
$.getScript("my_different_files.js");}
});
but now the plugin doesn't work (I won't detail the error because I only changed the javascript files loading process). What is the best way to mimic the javascript source loading using some url conditioned load ?
window.location.hrefand<some_url>at the time of calling? maybe some problem with url encoding of reserved characters?