Re: calling functions from cgi
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: calling functions from cgi

From: David Dorward <dorward@yahoo.com>
Date: Tue Jan 31 2006 - 00:30:13 CET

Tony Rice wrote:

> If I've loaded a set of functions in a webdocument like this:
> <script language="JavaScript" type="text/javascript"
> src="/js/foo.js"</script>

The language attribute is deprecated. You seem to have forgotten the ">"
from the opening script tag.

> Shouldn't I be able to call a function from inside foo.js later in that
> same document by doing something like this:
>
> <script language="JavaScript" type="text/javascript">myfunction(myargs)
> </script>

Yes.

> Even though it's generated from a CGI script?

How the server works out what to send to the user isn't relevant.

> The all loaded javascript files have the same scope do they not? It's not
> like the functions in foo.js available only to other functions within that
> file? Right?

Right.

-- 
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
                     Home is where the ~/.bashrc is
Received on Tue Feb 7 21:28:07 2006