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

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
add comment

2 Answers

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
add comment

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
add comment

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.