Re: script on page
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: script on page

From: alu <none@none.com>
Date: Tue Aug 30 2005 - 16:36:24 CEST

> "P4tryk" <p4tryk@patryk.pl> wrote
>
> <script>
> function go()
> {
> getElementById("replaceContent").innerHtml=httpReq.text;
> }
> </script>
>
> How to make the script from added innerHtml to run.

_______________________________________________

> > innerHTML is case sensitive, and getElementById is a
> > method of the document object.

> > The correct syntax would be:

> > document.getElementById("replaceContent").innerHTML=httpReq.text;
> > -alu
_______________________________________________

> > > ok, but how to make the script from the loaded page to run.
> > >
> > >
> > >Patryk
_______________________________________________

You are using XMLHttpRequest to load an alert? You may be trying to kill a
mosquito with a sledgehammer here....
I can't say I understand the structure of your page(s), or the purpose of
loading the alert in the background(?).
You are asking how to make the script from the loaded page run - all I can
think of is that you are asking how to call the function itself, perhaps?
If this is the case, just call the function as below:

<script>
    function go()
    {
        document.getElementById("replaceContent").innerHTML=httpReq.text;
    }
</script>

<div id="replaceContent"> </div>

<script>
    alert("form request");
 </script>

// somewhere in an appropriate place then, you would actually call the
function...

go();

Hope this solves the problem, if not, please explain clearly what you are
trying to achieve.
-alu
Received on Tue Oct 18 03:14:37 2005