Using a CustomAction in the location of a scriptlink, I'm inserting a javascript code, however I need this code to run after core.js runs. Does anyone know how I can achieve this?
My CustomAction elements file looks like this.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Location="ScriptLink" Sequence="10000" ScriptBlock="
var domain = document.domain;
/*
rest of my Javascript Code */
};"/>
</Elements>
I have tried to put my code within a function, and call ExecuteOrDelayUntilScriptLoaded but that didn't seem to work either.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Location="ScriptLink" Sequence="10000" ScriptBlock="
ExecuteOrDelayUntilScriptLoaded(MyCode, 'core.js');
function MyCode(){
var domain = document.domain;
/*rest of my Javascript Code */
};"/>
</Elements>
Can anyone help me?