javascript - How to call window load event on specific page -
i want call windows.load event on specific page. doing ..
$(window).load(function(){ if(document.url == "/car-driving.html") { overlay.show(); overlay.appendto(document.body); $('.popup').show(); return false; } });
here trying show overlay based on page load, not working. if remove if condition
overlay showing in every page. how make specific car-driving.html page if visit car-driving.html page, show overlay ?
try
if (window.location.href.match('car-driving.html') != null) { overlay.show(); overlay.appendto(document.body); $('.popup').show(); return false; }
hope helps
Comments
Post a Comment