Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy is my element not targeted when reload through AJAX
    primarykey
    data
    text
    <p>I'm using object literals on my project. I'm targeting selecting with jquery. It works fine the first time but when the part I'm targeting is reloaded with AJAX I can't target those element anymore. But I look into firebug they're there... I'm even doing console.log() to test if my code works and it works but it just doesn't want to pick those. So in order for it to work, I have to refresh the entire browser. Do you know what's the deal with AJAX dom reload and selectors.</p> <p>I think it's something to do with the DOM reloading and redrawing itself or something along those lines...</p> <p>Here is my code:</p> <pre><code>Module.editWishlistTitle = { wishListContent: $('.mod-wish-list-content'), title: $('.title').find('h2'), titleTextField: $('#wishlist-title-field'), titleInnerContainer: $('.title-inner'), editTitleForm: $('.edit-title-form'), submitCancelContainer: $('.submit-cancel'), notIE9: $.browser.msie &amp;&amp; $.browser.version &lt; 9, edit: function () { var fieldTxt = this.titleTextField.val(), editForm = this.editTitleForm, titleParent = this.titleInnerContainer, fieldCurrentTitle = this.title.text(); this.titleTextField.val(fieldCurrentTitle); this.submitCancelContainer.removeClass('hidden'); if (!this.notIE9) { editForm.css('opacity', 0).animate({ opacity: 1 }).removeClass('hidden'); titleParent.addClass('hidden').animate({ opacity: 0 }); console.log(editForm); } else { editForm.removeClass('hidden'); titleParent.addClass('hidden'); } } init: function () { var self = this; console.log(this.editTitleForm); //edit this.wishListContent.delegate('.edit-title a', 'click', function (e) { self.edit(); e.preventDefault(); }); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload