Chud37 Posted May 20, 2012 Share Posted May 20, 2012 Hello, I have an external jquery.shop.js file, and there are three pages where I need a donation box to popup. I built it on the first page, and it works fine, looks beautiful, etc. But when I implement the same code on the other two pages, it refuses to popup. I know the jquery file is referenced correctly and loading, because other functions in there are performing on the other pages too. But i cannot get any response out of it. It confuses me, because the code is the same, both in the HTML and the Jquery. What is stopping the [.click] function from performing? here is the code: $('#donateButton').click(function(){ alert('hello'); if(popupStat==0) { popupStat=1; $('#donationPopup').center(); $('#donationPopup').fadeIn('slow'); $('#content').fadeTo('slow', 0.2); } }); $('#closeButton').click(function(){ if(popupStat==1) { popupStat=0; $('#donationPopup').fadeOut('slow'); $('#content').fadeTo('slow', 1); } }); I put the alert hello in there to try and debug somewhat, and again, i get the alert on the first page, but the second and third pages are not showing anything at all. I am fairly new to jQuery, but not to programming. But this seems to be a re-occuring problem for me. Does it make a difference in what order my functions are placed in the .JS file? how could i further debug this? Can anyone help? Thanks, ~Richard Quote Link to comment https://forums.phpfreaks.com/topic/262820-simple-jquery-problem-hopefully/ Share on other sites More sharing options...
Chud37 Posted May 20, 2012 Author Share Posted May 20, 2012 Got it. I had referenced a function in the .JS file above my .click functions that wasnt working, at it was bombing out there. I removed that to see and it works fine. Quote Link to comment https://forums.phpfreaks.com/topic/262820-simple-jquery-problem-hopefully/#findComment-1347019 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.