Issue 76: Links does not trigger JS after setting the content via Inner HTML
Status:  Fixed
Owner: ----
Closed:  Jan 2009
Reported by faheemsa...@gmail.com, Sep 5, 2008
Hi,

I'm trying to implement nyromodal in my solutions and I'm struck with the
following issue

<script type="text/javascript">
$(function() {
  $('#editGeneralDetails').click(function(e) {
    e.preventDefault();
    $.nyroModalManual({
      url: 'edit.php',
      modal: true,
      resizeable: true
    });

    return false;
  });

});
</script>

<a id="editGeneralDetails" href="#">edit</a>

When I click edit for first time the modal is opened perfectly.

I have placed a button in the modal called "Save Changes" which calls an
ajax script.

I have written my own function which submit the form through ajax post and
in the handler, I close the modal window and set the content in the main
window container is reset using the script below

+ ajax call is made which returns the content

+ following is the handler

   if (XMLHTTP.xmlHttpObj.readyState==4 ||
XMLHTTP.xmlHttpObj.readyState=="complete") {

      var responseText   = XMLHTTP.xmlHttpObj.responseText;
      var divObj         = document.getElementById("formContainer");

      $(responseText).appendTo("#formContainer")

   }

=============================
So far everything is fine.

The following lines also set again using the above handler

<a id="editGeneralDetails" href="#">edit</a>

The problem is that when I click the edit link again, nothing happens and
the JS is not triggered.

Any smart solution for this please?

Thanks
Faheem
Hong Kong
Sep 7, 2008
Project Member #1 nyro...@gmail.com
Could you post or send yout HTML and JS files to investigatre more easily please ?
Labels: -Type-Defect Type-Other
Jan 26, 2009
Project Member #2 nyro...@gmail.com
 Issue 75  has been merged into this issue.
Jan 26, 2009
Project Member #3 nyro...@gmail.com
No files posted?
If not, I'll simply close this issue.
Jan 26, 2009
#4 faheemsa...@gmail.com
Sorry, you can close this.

The problem I had was due to the fact that the buttons were loaded using ajax and
hence it failed to bind with nyro. I have now managed it using the latest live
function in jquery
Jan 27, 2009
Project Member #5 nyro...@gmail.com
ok, thanks.
Status: Fixed