[thelist] Javascript Help

Joshua Earl jearl at adel.tafe.sa.edu.au
Wed Jul 26 20:25:51 CDT 2000


ok somthing simple for you all to get a giggle out of.

I have been staring at this code for a while now, and I just cant work
out why I keep getting an undefined error whenever I reference any of
the functions in this script;

<SCRIPT TYPE="text" LANGUAGE="javascript">
<!--
var cookieData = "";

function cookieMonster() {

if (document.cookie == "") {
 setCookie();
 goToLoc();
 }
else {
 readCookie();
 goToLoc();
}
}


function readCookie() {

var the_cookie = document.cookie;
var broken_cookie = the_cookie.split(":");
var the_name = broken_cookie[1];
var the_name = unescape(the_name);
cookieData = the_name;

}

function setCookie() {

var the_name = prompt("What's your Course ID?","");
document.cookie = "bullying=course_id:" + escape(the_name);
cookieData = the_name;

}

function goToLoc() {

var newLoc = "http://www.netlearn.discover.tased.edu.au:8900/" +
cookieData + "/intro.htm";
window.loc = newLoc;

}

//-->
</SCRIPT>
</HEAD>
<BODY>
<P><a href="#" onClick="setCookie()">this is the link that pops
  the dialog</a></P>
</BODY>
</HTML>

I have a hunch that it's something very simple, but I just cant see it
for all my looking.

Thanks Evolters.

--
Joshua Earl
Online Development Unit
Centre for Applied Learning Systems
email = jearl at adel.tafe.sa.edu.au
Ph = 61 8 8207 8439
\|\|\|\|\|\|\|\|\|\|\|\|\|\|\|\
Even if you're on the right track,
You'll get run over if
you just sit
there.
===
==
=






More information about the thelist mailing list