Sign up ×
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;


share|improve this question

2 Answers 2

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;

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


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.