Forum Moderators: open
Thank-you, Richard
<script language="JavaScript">
<!--
var url = "http://url/to_CGI_BIN/online.cgi";
if (document.title == "") {
title = "Unknown";
} else {
title = document.title;
}
document.write("<scr"+"ipt lan"+"guage='Jav"+"aScr"+"ipt' sr"+"c='"+url+"?title="+title+"'>");
document.write("</scr"+"ipt>");
//-->
</script>
The issue you face probably involves other code - perhaps your cgi code, or perhaps other javascript.
<script type="text/javascript">
<!--
var url = "http://url/to_CGI_BIN/online.cgi";
// get filename
var filename = window.location.href;
// check for "chat.htm" in filename
if (filename.search(/chat\.htm/i) > -1) {
// get the title of the page
var title = document.title;
if (title == "") {
title = "Unknown";
}
// create the new script element
var scr = document.createElement("script");
scr.type= "text/javascript";
// set its src
scr.src = url + "?title=" + title;
// append it to the head element
var head = document.getElementsByTagName("head")[0];
head.appendChild(scr);
}
//-->
</script>
...only if the filename has "chat.htm" somewhere in it will the script element be inserted that calls online.cgi.
Jordan