ExecuteOrDelayUntilScriptLoaded not firing for anonymous users
-
20. srpna 2012 9:33
Hi,
In master page I have the below custom java script function to resize tags on the page, the script doesn't fire for anaonymous users I have published the page and have verified that the function is present on the page (checked it thru view source). When I browse the page as owner all the alerts fire and the resizes4WP function sets the property fine where as for anonymous users only the alerts outside tot he function fire this means ExecuteOrDelayUntilScriptLoaded is not firing, so in the function call I tried using sp.js / core.js thinking that init.js may not be available for anonymous users but result is the same resize function does not fire. I am lost of ideas to fix it, stuck with this issue :( any help is appreciated.
<script type="text/javascript"> alert($("#s4-workspace").length); alert($("#cdiFooter").length); alert($("#PrintContent").length); function resizes4WP() { alert('s4-workspace' + $("#s4-workspace").length + ' |cdifooter' + $("#cdiFooter").length + ' |printcontent' + $("#PrintContent").length); if ($("#s4-workspace").length && $("#cdiFooter").length && $("#PrintContent").length) { $("#s4-workspace").css('height', (($("#PrintContent").height() + $("#PrintContent").offset().top + 325) + $("#cdiFooter").height()) + 'px'); $("#cdiFooter").css('top', (($("#s4-workspace").height() - $("#cdiFooter").height())) + 'px'); } alert('bye'); } ExecuteOrDelayUntilScriptLoaded(function () { SP.UI.Workspace.add_resized(resizes4WP); }, 'init.js'); </script>Regards,san
Všechny reakce
-
20. srpna 2012 13:41
Init.js is available for anonymous users. All the alerts at the top are firing for the anonymous users? And the lengths are greater than 0?
If I were debugging this, I would open this page in Firefox with Firebug turned on. This is the easiest way to see if any errors are being thrown in the scripts and may lead you to your problem.
Brandon Atkinson - Blog: http://brandonatkinson.blogspot.com/
-
21. srpna 2012 12:01
Thanks Brandon, not sure what the issue with ExecuteOrDelayUntilScriptLoaded, calling the javascript function at the end of page like old asp days works fine. Would love to use ExecuteOrDelayUntilScriptLoaded don't have enough time now, will revisit the issue later on and update if I find out the reason.
Cheers,
san