Skip to content Skip to sidebar Skip to footer

After Second Ajax Call Jquery Not Working

I'm getting a partial via ajax in asp.net mvc, it work fine for first time and second time but after that, it redirect to page instad of getting page via ajax. this is my partial p

Solution 1:

Your #getdata-@ViewBag.term is within the #retrieve-@ViewBag.term element but that gets replaced after the first call. You need to use event delegation.

Try this instead:

jqgd('#retrieve-@ViewBag.term').on('click', '#getdata-@ViewBag.term a', function () {
    ...
}

Solution 2:

This is just a shot in the dark:

Get e from your click handler then try e.preventDefault(); before the return false.

Post a Comment for "After Second Ajax Call Jquery Not Working"