Question

Im working with Sharepoint Online (0365), that is setup in classic mode, we just migrated over and attempting to set a few sites up, but have a challenge around the Minimal Download Strategy.

The reason: I have have some custom HTML, Java, and CSS that im importing into pages using Content Editor, and using div blocks for parts of the output from the java (for example i have a HTML page that is setup for a Side menu that is in the top right, while i have a main menu on the left - some of these parts i want to cascade to multiple sub-sites).Im uploading the code into the Site Assets folder, and calling the CSS and JAVA via Style and Script source tags.

The code its self works, however as i make changes to the code, it doesnt update the code called. If i clear the cache, it updates fine.

In the past using 2013 disabling the minimal download strategy worked as expected but on Sharepoint Online - it doesnt seem to?

Was it helpful?

Solution

Try to append a version wherever you are referring the JavaScript as example below. it will solve your issue.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>  
    <script type="text/javascript" src="/_layouts/15/sp.js"></script>  
<script type="text/javascript" src="/sites/abc/SiteAssets/Task%20Form/JS/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/sites/abc/SiteAssets/Task%20Form/JS/jquery-ui.js"></script>
<script type="text/javascript" src="/sites/abc/SiteAssets/Task%20Form/JS/BHQNewEditScript.js?v15"></script>
<link rel="stylesheet" href="/sites/abc/SiteAssets/Task%20Form/JS/jquery-ui.css">
<link rel="stylesheet" href="/sites/abc/SiteAssets/Task%20Form/BusinessQueryHandlingForm.css?v15">
</head>
<div class='divMain'>
</div>

in above example you can see i have appended v15 in our custom Javascript and CSS files. This method need to used even we you are pushing code changes after post production issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top