Issue 279: Doesn't work with dynamic content
Status:  Fixed
Owner: ----
Closed:  Jul 2009
Reported by sas.mes...@gmail.com, Jul 8, 2009
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
#1 sas.mes...@gmail.com
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."

Jul 9, 2009
Project Member #2 nyro...@gmail.com
try that:
$("something a").live("click", function(event) {
  event.preventDefault();
  $(this).nyroModalManual();
});
Jul 9, 2009
#3 sas.mes...@gmail.com
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
Project Member #4 nyro...@gmail.com
are you sure your live function is executed?
What's happen if you add an alert in this function?
Jul 9, 2009
#5 sas.mes...@gmail.com
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
Project Member #6 nyro...@gmail.com
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
#7 sas.mes...@gmail.com
I'm sorry but I'm not sure that what do you mean this... could you please explain?

Jul 9, 2009
Project Member #8 nyro...@gmail.com
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
#9 sas.mes...@gmail.com
Thank you so much! It's working now perfectly! :)
I'll test with every browser.

Jul 9, 2009
Project Member #10 nyro...@gmail.com
(No comment was entered for this change.)
Status: Fixed