4

In my master page I am calling the jquery method on pageload event. It will do some truncation operation in a SharePoint page. The problem is, if I have add new item to the SharePoint form and if I submit the form, my page got postback (refreshed) so the jquery method not called.

  • After submiting the form, if I reload the page its working properly.

Is there any way to call the jquery method in different event? How to resolvet the issue.

The below jquery only I am using in my page. Jquery

2
  • If your page got postback(refreshed), jQuery document ready event must fire. Check for javascript errors on postback. Jan 4, 2012 at 10:16
  • Can you post some code to help illustrate your question?
    – Russell
    Jan 4, 2012 at 13:03

1 Answer 1

2

If it is a partial refresh of the page, like in UpdatePanel, jQuery(document).ready(), or jQuery(window).load() don't fire. You must find some event that fires. You can start to lab with PageRequestManager. It helped me in my UpdatePanel.

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(doSomethingGreat);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.