473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Onclick problem

Hello everyone,

I am having a problem with the program below. I have isolated the problem
to the onclick event that is located throughout arrQuestions. The onclick
event refers to a function and passes it two parameters. For the life of me
I cannot figure out what the error is, but one occurs everytime I click a
&%*$&# radio button. Also, the function only alerts the user immediately
as to what question/answer they clicked. I am pretty much a rookie at
Javascript so I would appreciate any help that anyone might have time to
give.

<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns = "http://www.w3.org/1999/xhtml">

<head>
<title>Nascar Online Quiz</title>

<script type = "text/javascript">

<!--

var totalCorrect = 0;

var arrAnswers = new Array(10);

var arrCorrectAnswers = new Array("c", "d", "a", "c", "c", "d", "a", "c",
"b", "a");

var arrQuestions = new Array("<b>Who is the seven time Winston Cup Champion
who lost his life in the 2001 Daytona 500?</b><p>" +
"\n" +
"<input type='radio' name='question1' value='a'
onclick='funRecordAnswer(1, this.value)'>Jeff Gordon<br />" +
"<input type='radio' name='question1' value='b'
onclick='funRecordAnswer(1, this.value)'>Richard Petty<br />" +
"<input type='radio' name='question1' value='c'
onclick='funRecordAnswer(1, this.value)'>Dale Earnhardt<br />" +
"<input type='radio' name='question1' value='d'
onclick='funRecordAnswer(1, this.value)'>Fireball Roberts<br />" +
"</p>",

"<b>Which Winston Cup driver is a two-time Busch Grand National
Series Champion and holds four straight wins at Talladega AL?</b><p>" +
"\n" +
"<input type='radio' name='question2' value='a'
onclick='funRecordAnswer(2, this.value)'>Bobby Labonte<br />" +
"<input type='radio' name='question2' value='b'
onclick='funRecordAnswer(2, this.value)'>Kurt Busch<br />" +
"<input type='radio' name='question2' value='c'
onclick='funRecordAnswer(2, this.value)'>Tony Stewart<br />" +
"<input type='radio' name='question2' value='d'
onclick='funRecordAnswer(2, this.value)'>Dale Earnhardt, Jr<br />" +
"</p>",

"<b>Which Winston Cup driver come from Las Vegas Nevada where he
used to stack groceries to pay for racing on weekends?</b><p>" +
"\n" +
"<input type='radio' name='question3' value='a'
onclick='funRecordAnswer(3, this.value)'>Kurt Busch<br />" +
"<input type='radio' name='question3' value='b'
onclick='funRecordAnswer(3, this.value)'>Ken Schrader<br />" +
"<input type='radio' name='question3' value='c'
onclick='funRecordAnswer(3, this.value)'>Matt Kenseth<br />" +
"<input type='radio' name='question3' value='d'
onclick='funRecordAnswer(3, this.value)'>Mike Skinner<br />" +
"</p>",

"<b>Which Winston cup driver is a four-time champion known as boy
wonder?</b><p>" +
"\n" +
"<input type='radio' name='question4' value='a'
onclick='funRecordAnswer(4, this.value)'>Ryan Newman<br />" +
"<input type='radio' name='question4' value='b'
onclick='funRecordAnswer(4, this.value)'>Jimmie Johnson<br />" +
"<input type='radio' name='question4' value='c'
onclick='funRecordAnswer(4, this.value)'>Jeff Gordon<br />" +
"<input type='radio' name='question4' value='d'
onclick='funRecordAnswer(4, this.value)'>Jamie McMurray<br />" +
"</p>",

"<b>Which Winston cup driver hails from Missouri and owns a
dirt-track outside of St. Louis?</b><p>" +
"\n" +
"<input type='radio' name='question5' value='a'
onclick='funRecordAnswer(5, this.value)'>Casey Mears<br />" +
"<input type='radio' name='question5' value='b'
onclick='funRecordAnswer(5, this.value)'>Joe Nemechek<br />" +
"<input type='radio' name='question5' value='c'
onclick='funRecordAnswer(5, this.value)'>Ken Schrader<br />" +
"<input type='radio' name='question5' value='d'
onclick='funRecordAnswer(5, this.value)'>Jimmy Spencer<br />" +
"</p>",

"<b>Which driver has won more races in their career?</b><p>" +
"\n" +
"<input type='radio' name='question6' value='a'
onclick='funRecordAnswer(6, this.value)'>Rusty Wallace<br />" +
"<input type='radio' name='question6' value='b'
onclick='funRecordAnswer(6, this.value)'>Mark Martin<br />" +
"<input type='radio' name='question6' value='c'
onclick='funRecordAnswer(6, this.value)'>Dale Jarrett<br />" +
"<input type='radio' name='question6' value='d'
onclick='funRecordAnswer(6, this.value)'>Jeff Gordon<br />" +
"</p>",

"<b>Which of these drivers is from Missouri?</b><p>" +
"\n" +
"<input type='radio' name='question7' value='a'
onclick='funRecordAnswer(7, this.value)'>Rusty Wallace<br />" +
"<input type='radio' name='question7' value='b'
onclick='funRecordAnswer(7, this.value)'>Mark Martin<br />" +
"<input type='radio' name='question7' value='c'
onclick='funRecordAnswer(7, this.value)'>Dale Jarrett<br />" +
"<input type='radio' name='question7' value='d'
onclick='funRecordAnswer(7, this.value)'>Jeff Gordon<br />" +
"</p>",

"<b>Which driver was beaten by Dale Earnhardt for the 1990 Winston
Cup Championship?</b><p>" +
"\n" +
"<input type='radio' name='question8' value='a'
onclick='funRecordAnswer(8, this.value)'>Rusty Wallace<br />" +
"<input type='radio' name='question8' value='b'
onclick='funRecordAnswer(8, this.value)'>Ned Jarrett<br />" +
"<input type='radio' name='question8' value='c'
onclick='funRecordAnswer(8, this.value)'>Mark Martin<br />" +
"<input type='radio' name='question8' value='d'
onclick='funRecordAnswer(8, this.value)'>Dale Earnhardt, Jr<br />" +
"</p>",

"<b>Who currently drives the M&Ms sponsored car in Winston
Cup?</b><p>" +
"\n" +
"<input type='radio' name='question9' value='a'
onclick='funRecordAnswer(9, this.value)'>Ken Schrader<br />" +
"<input type='radio' name='question9' value='b'
onclick='funRecordAnswer(9, this.value)'>Elliott Sadler<br />" +
"<input type='radio' name='question9' value='c'
onclick='funRecordAnswer(9, this.value)'>Sterling Marlin<br />" +
"<input type='radio' name='question9' value='d'
onclick='funRecordAnswer(9, this.value)'>Ricky Craven<br />" +
"</p>",

"<b>Which of these drivers was a high school quarterback in
Nashville TN?</b><p>" +
"\n" +
"<input type='radio' name='question10' value='a'
onclick='funRecordAnswer(10, this.value)'>Sterling Marlin<br />" +
"<input type='radio' name='question10' value='b'
onclick='funRecordAnswer(10, this.value)'>Johnny Benson<br />" +
"<input type='radio' name='question10'
value='c' onclick='funRecordAnswer(10, this.value)'>Kenny Wallace<br />" +
"<input type='radio' name='question10'
value='d' onclick='funRecordAnswer(10, this.value)'>Steve Park<br />" +
"</p>"

);

function funPrintQuestions() {
var arrTest = new Array();
var j = 0;
var Test = false;

while ( j < 5) {
r_num = Math.floor(Math.random() * 10);

for ( var i = 0; i < arrTest.length; i++ ) {
if ( r_num == arrTest[i]) {
Test=true;
}
}

if ( Test == true ) {
Test = false;
continue;
}
else
{
arrTest[j] = r_num;
document.write(arrQuestions[r_num]);
j++;
}

} // end while
} // end function funPrintQuestions

function funInitialize() {
for ( var i = 0; i < arrAnswers.length; i++ )
arrAnswers[i] = "";

} // end funInitialize

function funRecordAnswer( question, answer ) {

window.alert(question);
window.alert(answer);
return;

} // end funRecordAnswer

function funPrintButtons() {

document.write("<input type = 'button' value='Grade Quiz'
onclick='funGradeQuiz()'>");
document.write("<input type = 'button' value='Refresh Quiz'
onclick='location.reload()'>");

} // end funPrintButtons

function funGradeQuiz() {

for ( var i = 0; i < 10; i++ ) {
if ( arrAnswers[i] == arrCorrectAnswers[i] )
totalCorrect++;
}

window.alert("You got " + totalCorrect + " correct!");
return;
} // end funGradeQuiz

// -->

</script>

</head>

<body onLoad = "funInitialize(); funPrintQuestions(); funPrintButtons();">

</body>

</html>

Thanks in advance,

Shock
Jul 20 '05 #1
8 3659
Shock wrote:
I am having a problem with the program below. I have isolated the problem
to the onclick event that is located throughout arrQuestions. The onclick
event refers to a function and passes it two parameters. For the life of me
I cannot figure out what the error is,
For Internet Explorer, you should go to Internet Options, Enhanced, Show
script errors.[1] In Mozilla/5.0 (incl. Netscape 6.2x+) you go to Tools,
Web Development, JavaScript Console. And in Opera (7), enable File,
Preferences, Multimedia, JavaScript, Open JavaScript Console on errors.[1]

[1] I don't now if this is the correct translation because I have only
German versions of the software here.
but one occurs everytime I click a &%*$&# radio button.
"There is an error" is an insufficient error *description*.
You could have at least told us with which browser(s) you have tested.
[...]
<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns = "http://www.w3.org/1999/xhtml">

<head>
<title>Nascar Online Quiz</title>

<script type = "text/javascript">

<!--
XHTML is an XML application, and a standards-compliant XML parser will cut
out the contents of the `script' element because it is required to remove
all comments from the markup before building the parse tree.

Do not use common SGML commenting for hiding scripts/style sheets in XHTML,
but declare the contents of such elements als CDATA which should not be
parsed. Then you *may* add the comment, for the agreement that a script
engine should ignore the leading `<!--':

<script type="text/javascript">
// <![CDATA[
// <!--
...
//-->
// ]]>
</script>

It is likely that this will also solve your script problems.
What is undefined, cannot be called (in event handlers.)
document.write(arrQuestions[r_num]);


There is no document.write(...) method for the XHTML DOM because that
could result in not well-formatted markup. If you use XHTML, you must
stick to the W3C-DOM and build the document node by node, using the
document.create...(...) and HTMLElement.appendChild(...) methods.

BTW: It is a Bad Thing[tm] to create documents that look empty without
client-side JavaScript. Use a server-side solution instead.
PointedEars

Jul 20 '05 #2
For the sake of simplicity I tore out the XML/XHTML references and left the
javascript code strictly within HTML tags. Sorry I didn't post the message,
3 am and I wasn't thinking clearly. The error message is still the same
"line 6, object expected. I still think that the onclick event isn't
finding the function I have specified, but I don't know why.

Shock

BTW IE6

Here is the latest version of the code

<html>

<head>
<title>Nascar Online Quiz</title>

<script type = "text/javascript">

<!--

var totalCorrect = 0;

var arrAnswers = new Array(10);

var arrCorrectAnswers = new Array("c", "d", "a", "c", "c", "d", "a", "c",
"b", "a");

var arrQuestions = new Array("<b>Who is the seven time Winston Cup Champion
who lost his life in the 2001 Daytona 500?</b><p>" +
"\n" +
"<input type='radio' name='question1' value='a'
onclick='funRecordAnswer(1, this.value)'>Jeff Gordon<br />" +
"<input type='radio' name='question1' value='b'
onclick='funRecordAnswer(1, this.value)'>Richard Petty<br />" +
"<input type='radio' name='question1' value='c'
onclick='funRecordAnswer(1, this.value)'>Dale Earnhardt<br />" +
"<input type='radio' name='question1' value='d'
onclick='funRecordAnswer(1, this.value)'>Fireball Roberts<br />" +
"</p>",

"<b>Which Winston Cup driver is a two-time Busch Grand National
Series Champion and holds four straight wins at Talladega AL?</b><p>" +
"\n" +
"<input type='radio' name='question2' value='a'
onclick='funRecordAnswer(2, this.value)'>Bobby Labonte<br />" +
"<input type='radio' name='question2' value='b'
onclick='funRecordAnswer(2, this.value)'>Kurt Busch<br />" +
"<input type='radio' name='question2' value='c'
onclick='funRecordAnswer(2, this.value)'>Tony Stewart<br />" +
"<input type='radio' name='question2' value='d'
onclick='funRecordAnswer(2, this.value)'>Dale Earnhardt, Jr<br />" +
"</p>",

"<b>Which Winston Cup driver come from Las Vegas Nevada where he
used to stack groceries to pay for racing on weekends?</b><p>" +
"\n" +
"<input type='radio' name='question3' value='a'
onclick='funRecordAnswer(3, this.value)'>Kurt Busch<br />" +
"<input type='radio' name='question3' value='b'
onclick='funRecordAnswer(3, this.value)'>Ken Schrader<br />" +
"<input type='radio' name='question3' value='c'
onclick='funRecordAnswer(3, this.value)'>Matt Kenseth<br />" +
"<input type='radio' name='question3' value='d'
onclick='funRecordAnswer(3, this.value)'>Mike Skinner<br />" +
"</p>",

"<b>Which Winston cup driver is a four-time champion known as boy
wonder?</b><p>" +
"\n" +
"<input type='radio' name='question4' value='a'
onclick='funRecordAnswer(4, this.value)'>Ryan Newman<br />" +
"<input type='radio' name='question4' value='b'
onclick='funRecordAnswer(4, this.value)'>Jimmie Johnson<br />" +
"<input type='radio' name='question4' value='c'
onclick='funRecordAnswer(4, this.value)'>Jeff Gordon<br />" +
"<input type='radio' name='question4' value='d'
onclick='funRecordAnswer(4, this.value)'>Jamie McMurray<br />" +
"</p>",

"<b>Which Winston cup driver hails from Missouri and owns a
dirt-track outside of St. Louis?</b><p>" +
"\n" +
"<input type='radio' name='question5' value='a'
onclick='funRecordAnswer(5, this.value)'>Casey Mears<br />" +
"<input type='radio' name='question5' value='b'
onclick='funRecordAnswer(5, this.value)'>Joe Nemechek<br />" +
"<input type='radio' name='question5' value='c'
onclick='funRecordAnswer(5, this.value)'>Ken Schrader<br />" +
"<input type='radio' name='question5' value='d'
onclick='funRecordAnswer(5, this.value)'>Jimmy Spencer<br />" +
"</p>",

"<b>Which driver has won more races in their career?</b><p>" +
"\n" +
"<input type='radio' name='question6' value='a'
onclick='funRecordAnswer(6, this.value)'>Rusty Wallace<br />" +
"<input type='radio' name='question6' value='b'
onclick='funRecordAnswer(6, this.value)'>Mark Martin<br />" +
"<input type='radio' name='question6' value='c'
onclick='funRecordAnswer(6, this.value)'>Dale Jarrett<br />" +
"<input type='radio' name='question6' value='d'
onclick='funRecordAnswer(6, this.value)'>Jeff Gordon<br />" +
"</p>",

"<b>Which of these drivers is from Missouri?</b><p>" +
"\n" +
"<input type='radio' name='question7' value='a'
onclick='funRecordAnswer(7, this.value)'>Rusty Wallace<br />" +
"<input type='radio' name='question7' value='b'
onclick='funRecordAnswer(7, this.value)'>Mark Martin<br />" +
"<input type='radio' name='question7' value='c'
onclick='funRecordAnswer(7, this.value)'>Dale Jarrett<br />" +
"<input type='radio' name='question7' value='d'
onclick='funRecordAnswer(7, this.value)'>Jeff Gordon<br />" +
"</p>",

"<b>Which driver was beaten by Dale Earnhardt for the 1990 Winston
Cup Championship?</b><p>" +
"\n" +
"<input type='radio' name='question8' value='a'
onclick='funRecordAnswer(8, this.value)'>Rusty Wallace<br />" +
"<input type='radio' name='question8' value='b'
onclick='funRecordAnswer(8, this.value)'>Ned Jarrett<br />" +
"<input type='radio' name='question8' value='c'
onclick='funRecordAnswer(8, this.value)'>Mark Martin<br />" +
"<input type='radio' name='question8' value='d'
onclick='funRecordAnswer(8, this.value)'>Dale Earnhardt, Jr<br />" +
"</p>",

"<b>Who currently drives the M&Ms sponsored car in Winston
Cup?</b><p>" +
"\n" +
"<input type='radio' name='question9' value='a'
onclick='funRecordAnswer(9, this.value)'>Ken Schrader<br />" +
"<input type='radio' name='question9' value='b'
onclick='funRecordAnswer(9, this.value)'>Elliott Sadler<br />" +
"<input type='radio' name='question9' value='c'
onclick='funRecordAnswer(9, this.value)'>Sterling Marlin<br />" +
"<input type='radio' name='question9' value='d'
onclick='funRecordAnswer(9, this.value)'>Ricky Craven<br />" +
"</p>",

"<b>Which of these drivers was a high school quarterback in
Nashville TN?</b><p>" +
"\n" +
"<input type='radio' name='question10' value='a'
onclick='funRecordAnswer(10, this.value)'>Sterling Marlin<br />" +
"<input type='radio' name='question10' value='b'
onclick='funRecordAnswer(10, this.value)'>Johnny Benson<br />" +
"<input type='radio' name='question10'
value='c' onclick='funRecordAnswer(10, this.value)'>Kenny Wallace<br />" +
"<input type='radio' name='question10'
value='d' onclick='funRecordAnswer(10, this.value)'>Steve Park<br />" +
"</p>"

);

function funPrintQuestions() {
var arrTest = new Array();
var j = 0;
var Test = false;

while ( j < 5) {
r_num = Math.floor(Math.random() * 10);

for ( var i = 0; i < arrTest.length; i++ ) {
if ( r_num == arrTest[i]) {
Test=true;
}
}

if ( Test == true ) {
Test = false;
continue;
}
else
{
arrTest[j] = r_num;
document.write(arrQuestions[r_num]);
j++;
}

} // end while
} // end function funPrintQuestions

function funInitialize() {
for ( var i = 0; i < arrAnswers.length; i++ )
arrAnswers[i] = "";

} // end funInitialize

function funRecordAnswer( question, answer ) {

window.alert(question);
window.alert(answer);
return;

} // end funRecordAnswer

function funPrintButtons() {

document.write("<input type = 'button' value='Grade Quiz'
onclick='funGradeQuiz()'>");
document.write("<input type = 'button' value='Refresh Quiz'
onclick='location.reload()'>");

} // end funPrintButtons

function funGradeQuiz() {

for ( var i = 0; i < 10; i++ ) {
if ( arrAnswers[i] == arrCorrectAnswers[i] )
totalCorrect++;
}

window.alert("You got " + totalCorrect + " correct!");
return;
} // end funGradeQuiz

// -->

</script>

</head>

<body onLoad = "funInitialize(); funPrintQuestions(); funPrintButtons();">

</body>

</html>
Jul 20 '05 #3
"Shock" <sh*****@charter.net> wrote in message
news:vo************@corp.supernews.com...
<snip>
function funPrintButtons() {

document.write("<input type = 'button' value='Grade Quiz'
onclick='funGradeQuiz()'>");
document.write("<input type = 'button' value='Refresh Quiz'
onclick='location.reload()'>");

} // end funPrintButtons snip><body
onLoad = "funInitialize(); funPrintQuestions(); funPrintButtons();">

<snip>

You are calling document.write after the original document has been
closed (in the onload event). That will result in the current document
being cleared and replaced, and when it is cleared all of the JavaScript
functions go with it.

Richard.
Jul 20 '05 #4
Sorry, I am not sure I understand. I thought document.write simply wrote
the line into the document. When was the document closed?

Shock
"Richard Cornford" <Ri*****@litotes.demon.co.uk> wrote in message
news:bm*******************@news.demon.co.uk...
"Shock" <sh*****@charter.net> wrote in message
news:vo************@corp.supernews.com...
<snip>
function funPrintButtons() {

document.write("<input type = 'button' value='Grade Quiz'
onclick='funGradeQuiz()'>");
document.write("<input type = 'button' value='Refresh Quiz'
onclick='location.reload()'>");

} // end funPrintButtons

snip>
<body
onLoad = "funInitialize(); funPrintQuestions(); funPrintButtons();">

<snip>

You are calling document.write after the original document has been
closed (in the onload event). That will result in the current document
being cleared and replaced, and when it is cleared all of the JavaScript
functions go with it.

Richard.

Jul 20 '05 #5
"Shock" <sh*****@charter.net> writes:
Sorry, I am not sure I understand. I thought document.write simply wrote
the line into the document. When was the document closed?


The document was closed when it finished loading, i.e., *just* before
the document's onload event happens.

While loading the page, the page is processed from top to bottom. A
script is executed when this process reaches it, and a document.write
inserts content between the script that calls it and the remaining,
unprocessed, code.

When processing reaches the end of the document, it is finished. This
closes the document and then calls the onload handler. That means that
document.write's in the onload handler will reopen, and thereby clear,
the document.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #6
Ok, I understand what you mean, but now I am confused on how to get the
functions to work without actually calling them.

Thanks,

Shock
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:7k**********@hotpop.com...
"Shock" <sh*****@charter.net> writes:
Sorry, I am not sure I understand. I thought document.write simply wrote the line into the document. When was the document closed?


The document was closed when it finished loading, i.e., *just* before
the document's onload event happens.

While loading the page, the page is processed from top to bottom. A
script is executed when this process reaches it, and a document.write
inserts content between the script that calls it and the remaining,
unprocessed, code.

When processing reaches the end of the document, it is finished. This
closes the document and then calls the onload handler. That means that
document.write's in the onload handler will reopen, and thereby clear,
the document.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'

Jul 20 '05 #7
Ok, I got it.. I just put a direct call in for the first function after I
defined my global variables and arrays. It works and I understand it better
now...I had just never put a direct call in the script like
that...duh..hehe..
.. Thanks everybody for the help!

Shock

"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:7k**********@hotpop.com...
"Shock" <sh*****@charter.net> writes:
Sorry, I am not sure I understand. I thought document.write simply wrote the line into the document. When was the document closed?


The document was closed when it finished loading, i.e., *just* before
the document's onload event happens.

While loading the page, the page is processed from top to bottom. A
script is executed when this process reaches it, and a document.write
inserts content between the script that calls it and the remaining,
unprocessed, code.

When processing reaches the end of the document, it is finished. This
closes the document and then calls the onload handler. That means that
document.write's in the onload handler will reopen, and thereby clear,
the document.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'

Jul 20 '05 #8
Shock wrote:
For the sake of simplicity I tore out the XML/XHTML references and left the
javascript code strictly within HTML tags. Sorry I didn't post the message,
3 am and I wasn't thinking clearly. The error message is still the same
"line 6, object expected. I still think that the onclick event isn't
finding the function I have specified, but I don't know why.
[...]
var arrQuestions = new Array("<b>Who is the seven time Winston Cup Champion
who lost his life in the 2001 Daytona 500?</b><p>" +
"\n" +
"<input type='radio' name='question1' value='a'
onclick='funRecordAnswer(1, this.value)'>Jeff Gordon<br />" +


The document.write(...) issue aside, you need to mask SGML End Tag Open
(ETAGO) delimiters (`</') in HTML-embedded JavaScript with `<\/', otherwise
a strict SGML Parser will assume the end of the `script' element. And you
do not want to use XML syntax (<tag />) in HTML, because it is the short tag
syntax there.

Please do not post your entire source code (240 lines!) here, but only the
necessary fragments. If you think the whole source code is required, post
an URL to the document, previously uploading it if necessary. Bandwidth is
precious.
PointedEars

Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
17
by: Mike Gratee | last post by:
Is it possible to use JavaScript to cause the browser to click a link on a page and have the browser act exactly like the user had clicked on the link directly? In other words, I need to...
8
by: KS | last post by:
Just to show some code to show the consept. <img id="date" onclick="javascript:show_calendar();" src="/PlexSysWeb/images/show-calendar.gif" width=20 height=18 border=0> What i want the...
5
by: moondaddy | last post by:
I have a <a> element in a datagrid which wraps some asp.net labels. this element also has an onclick event which does not fire in netscape 6 (and perhaps other browsers for all I know...). Below...
11
by: GaryB | last post by:
Hi Guys, I've been battling with this one for hours - I hope that you can help me! My code modifies the <aon a page, from a standard document link into a link with a tailored onclick event. ...
7
by: abs | last post by:
Hi everyone. Please, check my test code here: http://skocz.pl/jstest . The trouble is that no matter which span element I click, it alerts '3' and I'm wondering why not '1' for the first span,...
3
by: Michael_R_Banks | last post by:
I'm trying to dynamically build a table that allows users to remove rows when they click a corresponding button. For some reason, whenever I add the button to the table, it never fires the onclick...
2
by: stevemtno | last post by:
I've got a problem with a web page I'm working on. I have 4 modules - one of them has 2 tabs, two of them have 4 tabs. When the user clicks on the tabs, the content below them changes. However, when...
2
by: DavidGeorge | last post by:
In an earlier thread I recounted a problem I was having, but it took a while to reduce the problem to it's basic components and the issue became somewhat confused in reaching that point. I hope you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.