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;




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.


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;    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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