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: Tony Rice <CMQPEWPHFNYK@spammotel.com>
Date: Tue Jan 31 2006 - 17:27:34 CET

RobG <rgqld@iinet.net.au> wrote in news:zvBDf.251$Nv4.46029
@news.optus.net.au:

> That sounds like you are trying to access elements before the page has
> created them, either onload or after the AJAX stuff.
>
> Code snippet? URL?

I'm using jah (http://microformats.org/wiki/rest/ahah) to load URLs inline
dynamically. The perl script looks like this:

my $ajaxcall="jah('myotherscript.cgi?myarg=arg', 'contentdiv')";
if (param('myparam')){
  print "<script type=\"text/javascript\">$ajaxcall</script>\n";

}else{
  print a({href=>"javascript:$ajaxcall"}, 'click to load');
}
print "<div id='contentdiv'></div>\n";

The goal is to have the content loaded inline automatically if the
'myparam' is passed in the query string and make it loadable inline by
clicking the link.

I'm getting the following errors:

document.getElementById(target) has no properties

and

href has no properties

These are both coming from the ahah code. What I dont get is what is
special about the click. Either way it's accessing the document object so
it's not like the click is providing an object.

Any ideas?

> Did you fix the missing '>' from the closing script
> tag noted in other responses?

yes. That was a cut and paste error between the code and my newsreader.
Received on Tue Feb 7 21:28:57 2006