Changing JScript global variable values dynamically

From: Peter (peter1234se_at_yahoo.se)
Date: 05/14/04


Date: 14 May 2004 01:43:56 -0700

Using the IWebBrowser2 ActiveX plugin, I can access the html page's
IHTMLDocument interface and from there get access to
IHTMLScriptElement.
But is there a way to actually go into running scripts and dynamically
changing e.g global JScript variable values?
I have succeeded in changing variable initializations before the page
is displayed by calling the IHTMLScriptElement::put_text, but this
only affects the initial values.

I then tried to have a script setting the value
<SCRIPT LANGUAGE=javascript>
function setValue()
{
 myglobal = 1;
}
</SCRIPT>

which periodically is called in the page, and when I want to change
the value I replace this scripts text. This did not seem to work.
Perhaps all scripts are preloaded and not read again every time they
are executed?

Any suggestions of how to do this?

Peter



Relevant Pages

  • Re: "modern" javascript...
    ... The same can be true for scripts in HTML. ... augmentation (which is pretty bad as support for this is specified as being ... An event registry is not of much use if adding the primary listener is not ...
    (comp.lang.javascript)
  • Re: Advice on distutils and distribution policies
    ... These might be scripts that are modified as a ... > HTML and CSS files that are to be handled directly by the web browser is ... > directly by the web server) van be anywhere under /var, ... And this is the HTML one (which is a template that is used by the python ...
    (comp.lang.python)
  • Re: Any script at all?
    ... Java and scripts are 2 very different things. ... Javascript is certainly not part of HTML. ...
    (microsoft.public.scripting.jscript)
  • Question
    ... I am looking to be able to print HTML documents from a linux ... command line via scripts and I was wondering ... HTML if another tool will do that in the script. ... to take advantage of the compression tools when storing the documents as ...
    (alt.os.linux)
  • Re: Help with windows Media Scripts
    ... Relative URLs like that are a security concern, ... > Having big problems with windows media URL scripts. ... > Embedded player in one frame, want to fire up HTML Pages in another frame. ... > location as the .wmv file. ...
    (microsoft.public.windowsmedia)