| Issue 279: | Doesn't work with dynamic content | |
| 2 people starred this issue and may be notified of changes. | Back to list |
|
What steps will reproduce the problem? 1. I'm using the v1.5.0 and get a DIV content via XMLHttpRequest... This DIV content lots of HTML code like this: <div class="something"> <a href="/images/pics.jpg" id="id_a_vp_1" class="nyroModal" title="Desc"><img src="/images/thumbs/tn_pics.jpg" id="id_img_vp_1" alt="desc" border="0"></a> </div> 2. If click to the link nyroModal doesn't work, the link open in a normal windowtab 3. If I use this code (above) in a static page without dynamic loading, it works. What is the expected output? What do you see instead? Doesn't open in nyro-popup. What version of the product are you using? On what operating system? 1.5.0, jquery 1.3.2, windows xp, linux Please provide any additional information below. It's same in every browser... I'll upload it to somewhere to demonstrate the issue.
Jul 9, 2009
try that:
$("something a").live("click", function(event) {
event.preventDefault();
$(this).nyroModalManual();
});
Jul 9, 2009
I did it. Now don't get error message but it still doesn't work. It's opening in normal window-tab.
Jul 9, 2009
are you sure your live function is executed? What's happen if you add an alert in this function?
Jul 9, 2009
Yes, I'm sure... Here it is the test page: without event.preventDefault(); http://www.sashq.hu/dsilence/test.php with event.preventDefault(); http://www.sashq.hu/dsilence/test2.php
Jul 9, 2009
your code on js/iws-jquery-test2.js and iws-jquery-test.js aren't wraped in a
$(function() { ... });
Could you try that please?
Jul 9, 2009
I'm sorry but I'm not sure that what do you mean this... could you please explain?
Jul 9, 2009
Sorry, I missread your code.
Actually, it looks like it's working, isnt'it?
on your code, I still see 1 thing:
$("#test_result_dynamic a").live("click", function() {
should read like
$("#test_result_dynamic a").live("click", function(event) {
Jul 9, 2009
Thank you so much! It's working now perfectly! :) I'll test with every browser.
Jul 9, 2009
(No comment was entered for this change.)
Status:
Fixed
|
||||||||
If I use the .live event: $("something a").live("click", function() { event.preventDefault(); this.nyroModalManual(); }); I get an error message: "event is not defined" If I comment it: $("something a").live("click", function() { // event.preventDefault(); this.nyroModalManual(); }); I get this error: "this.nyroModalManual is not a function."