jquery - Check if window pathname(url) has specific value -
good day.
i want check if current browser window pathname has specific value or not...
but code not working...any help?
jquery(function($){ var pathname = window.location.pathname; if ($pathname == 'http://google.com') { alert($pathname); } }); thank you
if ($pathname == 'http://google.com') { should be
if (pathname == 'http://google.com') { //no $ because declared as
var pathname = window.location.pathname;
Comments
Post a Comment