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

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -