SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We had previously used the following to stop the page refreshing when closing a document. This works fine in Sharepoint 2007 but doesn't work in 2010. Does anyone know the SP 2010 equivalent

g_varSkipRefreshOnFocus = true;

from

http://mattknott.com/content/blog/2009/08/Stop_DispEx_Redirecting.html

share|improve this question

You need to put the code in after core.js and before you start your code. Will work in a content editor webpart.

<script type="text/javascript">
    g_varSkipRefreshOnFocus = true;
</script> 

for testing you just add the content editor web part.

share|improve this answer

You could also put it in windows load, did not work in document ready for me...

$(window).load(function () {
    console.log("g_varSkipRefreshOnFocus set to true!");
    g_varSkipRefreshOnFocus = true;    
});
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.