My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 75: Links does not trigger JS after setting the content via Inner HTML
2 people starred this issue and may be notified of changes. Back to list
Status:  Duplicate
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
Jan 26, 2009
Project Member #1 nyro...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 76

Powered by Google Project Hosting