jQuery/Javascript seems to stop working? -
i'm still learning jquery (1.6 min) , javascript, have been quite pleased have been able achieve, far, problem has me fooled - i've been looking @ 4 hours!
i have following link on page contained within (for id value 'northwest'):-
<figure><a href="http://localhost:8888/popup/pfs98394" class="popupsimple"><img src="http://localhost:8888/98394.jpg" alt="" border="0"></a></figure> which when clicked on, correctly loads content in makes visible. not reload page, makes div visible on top of current content. javascript doing uses standard jquery fancybox.
all works fine, div can shown , hidden several times, loading different information on each occasion. there img button allows user reload 'northwest' div latest content - when clicked executes code:
$(".refreshthumb").find("a").click(function(){ $(".refreshloader").show(); $("#northwest").load("/refreshdata"); settimeout(refreshhide,1000); }); the settimeout line refers small graphic (refreshloader) momentarily displayed advise user refresh of data taking place.
now, take out $("#northwest").load etc.. line , works fine. add line in, , popupsimple link works fine until img button clicked refresh northwest div, after popupsimple content loaded new page , no longer overlaid - before clicking popup overlay works fine no matter how many times click it.
edit: should point out after clicking on img button reload northwest div successfully, when click popupsimple link things go wrong!
what have done wrong? i'm using safari , @ web inspector window after page has been reloaded rather loaded div shows:
<script type="text/javascript"> $(document).ready(function() { with message saying reference error: can't find variable $.
can point me in right direction .... please!
it sounds eventlistener issue, try using .on('click',function(){} instead of .click(function(){}
Comments
Post a Comment