sharepoint - Script file file not being loaded through ScriptLink custom action -


i having trouble script link custom actions. building sharepoint app, , added site-scope custom action pointing script file in style library, want particular script injected pages of sharepoint site.

while works in situations, script link injection breaks without apparent reason under conditions. example, when arrive on root web, script injected. but, if go link within web (for example home or site contents), file supposed injected not fetched style library , therefore never injected, resulting in uncaught referenceerror when try call 1 of script's function. weirdest part page refresh through ctrl+f5 fetch script file without problem, regardless of page's ability fetch script file when first accessed. keep script until accessed through link again.

i've read on sharepoint caching, thinking may cause of problem, trouble these articles talk cache-induced errors when updating file, while trying access it.

one thing note that, due limitations, adding script link custom action through code. here's example of kind of call looks in app:

context.load(context.site.usercustomactions); context.executequery();  customaction.name = "myscriptlink"; customaction.location = "scriptlink"; customaction.sequence = 100; customaction.scriptsrc = "~sitecollection/style library/mysite/myscript.js";  customaction.update(); context.executequery(); 

so, what's going on here ? why script no injected on pages ? why refresh on these exact same pages manage fetch file without problem ?

found ! 3 words: minimum download strategy. disable it, messes page redirect behavior within sharepoint site (either through code or through site settings)

edit: if still want mds enabled on site, there solution


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -