Skybound.Gecko.SimpleObjectForScripting.RunRawJavaScriptOnClient C# (CSharp) Méthode

RunRawJavaScriptOnClient() public méthode

This will run arbitraty javascript on the client. It creates a script block in the DOM tree and the javascript gets executed. The script block is not permanent. It will be removed on the next call to this method, and replaced by new arbitarty code.
public RunRawJavaScriptOnClient ( string strSourceJavaScript, bool wrapTryCatch ) : void
strSourceJavaScript string The JavaScript Code
wrapTryCatch bool If true it will att a javascript try/catch block for the incomming code.
Résultat void
        public void RunRawJavaScriptOnClient(string strSourceJavaScript, bool wrapTryCatch)
        {
            if (strSourceJavaScript.Length > 0)
            {
                if (wrapTryCatch == false)
                {
                    ScriptBuilder(strSourceJavaScript);
                }
                else
                {
                    ScriptBuilder("try {" + strSourceJavaScript + "}catch(anError){ dump(anError); alert(anError); }");
                }
            }
        }