Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

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

1 Answer 1

up vote 2 down vote accepted

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);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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