<doc>
  <legacy_id>3519</legacy_id>
  <name>revBrowserExecuteScript</name>
  <type>function</type>
  <syntax>
    <example>revBrowserExecuteScript(<i>instanceId</i>, <i>script)</i></example>
  </syntax>
  <library>Browser Library</library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
  </classification>
  <references>
    <function tag="revBrowserCallScript">revBrowserCallScript Function</function>
  </references>
  <history>
    <introduced version="3.5">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
  </platforms>
  <classes>
    <desktop/>
  </classes>
  <security>
    <network/>
  </security>
  <summary>Executes a string as web script in the context of the specified browser object.</summary>
  <examples>
    <example>get revBrowserExecuteScript(sBrowserId, "alert('This is a debugging message');"</example>
    <example>get revBrowserExecuteScript(sBrowserId, the text of field "JavaScript" of me)</example>
  </examples>
  <description>
    <p>Use the <b>revBrowserExecuteScript</b> function to modify the current page being displayed in a browser object, or to retrieve information about it.</p><p/><p><b>Parameters:</b></p><p>The <i>instanceId</i>  is the integer identifier of a browser object</p><p>The <i>script</i> is a string containing the web script to execute.</p><p/><p><b>Comments:</b></p><p>The <b>revBrowserExecuteScript</b> function currently executes JScript on Windows and JavaScript on OS X. If the specified <i>script</i> contains more than one line, each line must be terminated with a semi-colon (;). </p><p/><p>The return value of the function is the value of the "result" global variable in the script environment. Any values to be returned from the script should be placed into this variable. For example the following line of code produces the result "2":</p><p/><p>put revBrowserExecuteScript(sBrowserId, "result = 1 + 1;")</p><p/><p>If there is an existing JavaScript function you wish to call, its better to use the <function tag="revBrowserCallScript">revBrowserCallScript function</function> instead. This will be faster than executing arbitrary code and also allows parameters to be passed.</p><p/><p>If the <i>script</i> fails to execute, an "error in script" exception will be thrown.</p><p/><p><b>Note:</b> For general information on using the browser library, please see the notes in the <function tag="revBrowserOpen">revBrowserOpen function</function> reference.</p>
  </description>
</doc>