Run your script if on a specific web page
2 answers
I don't know if it helps, but on this page, if you are using window.location, you can do something like the following:
window.location['href']
=> "http://stackoverflow.com/questions/9709337/run-script-if-on-certain-webpage"
window.location['pathname']
=> "/questions/9709337/run-script-if-on-certain-webpage"
you can do something like this if you are using JQuery
if( window.location['pathname'] === 'desired_path')
$('body').append($('<script ... ></script>'))
0
source to share