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: RobG <rgqld@iinet.net.au>
Date: Tue Jan 31 2006 - 00:30:29 CET

Tony Rice wrote:
> If I've loaded a set of functions in a webdocument like this:
>
>
> <script language="JavaScript" type="text/javascript"

Language is deprecated, drop it.

> src="/js/foo.js"</script>
>
> 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? The all loaded javascript

What is generated from CGI - the script or the HTML document?

> 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?

Yes.

Do you get errors? What is the error message? Is the error because the
file isn't loaded, or because you are trying to manipulate objects in
the page before it's full loaded?

-- 
Rob
Received on Tue Feb 7 21:28:07 2006