[thelist] Javascript Help

Chris Evans chris at fuseware.com
Wed Jul 26 22:27:13 CDT 2000


It could be that your first function calls other functions which have not
yet been declared.  I always set my basic functions first ( ReadCookie,
Setcookie) before I set my encapsulating functions ( CookieMonster).

Again, this could just be a style thing, but it may also be a style ruled by
function.

Chris Evans
chris at fuseware.com
http://www.fuseware.com


-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Joshua Earl
Sent: Wednesday, July 26, 2000 9:09 PM
To: thelist at lists.evolt.org
Subject: [thelist] Javascript Help


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.
===
==
=



---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !






More information about the thelist mailing list