Blogger template rejects javascript loop

J

Jim

I'm a newbie so I'm probably doing something simple and dumb but I just
can't get Blogger to accept a JavaScript for/next loop.

Here's what I've tried

<Script Language='JavaScript>
{
for (var i = 0; i < 16; i++)
{
Code to do stuff here with checkboxes. But, no matter what I put
here, including nothing, Blogger says this for/loop code is not formed
correctly.
}
}
</Script>

Is there something wrong with my syntax here or is it just a Blogger thing?

Any help would be greatly appreciated.
 
N

nolo contendere

I'm a newbie so I'm probably doing something simple and dumb but I just
can't get Blogger to accept a JavaScript for/next loop.

Here's what I've tried

<Script Language='JavaScript>
{
for (var i = 0; i < 16; i++)
{
Code to do stuff here with checkboxes. But, no matter what I put
here, including nothing, Blogger says this for/loop code is not formed
correctly.
}}

</Script>

Is there something wrong with my syntax here or is it just a Blogger thing?

Why are there curly braces surrounding your 'for' loop?
 
T

Thomas 'PointedEars' Lahn

Jim said:
Here's what I've tried

<Script Language='JavaScript>
{
for (var i = 0; i < 16; i++)
{
Code to do stuff here with checkboxes. But, no matter what I put
here, including nothing, Blogger says this for/loop code is not formed
correctly.
}
}
</Script>

Is there something wrong with my syntax here or is it just a Blogger thing?

Any help would be greatly appreciated.

http://www.interhack.net/pubs/munging-harmful/
http://validator.w3.org/
http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you


PointedEars
 
N

nolo contendere

I'm a newbie so I'm probably doing something simple and dumb but I just
can't get Blogger to accept a JavaScript for/next loop.

Here's what I've tried

<Script Language='JavaScript>
{
for (var i = 0; i < 16; i++)
{
Code to do stuff here with checkboxes. But, no matter what I put
here, including nothing, Blogger says this for/loop code is not formed
correctly.
}}

</Script>

Is there something wrong with my syntax here or is it just a Blogger thing?

Also, there's no end quote after 'Javascript

....you may want to add that.
 
J

Jim

nolo, here is my actual code without the stuff in the middle. My missing
single quote was just a typo.

<Script Language='Javascript'>
//Gets a count
function getcount(form)
{
for ( var i = 0; i < 16; i++)
{
(stuff to do)
}
}
</Script>

Like I said, I'm a newbie and trying to piece javascript out using web
tutors.

Here's the error message from Blogger:
Your template could not be parsed as it is not well-formed. Please make sure
all XML elements are closed properly.
XML error message: The content of elements must consist of well-formed
character data or markup.

All elements are closed. I've checked and double checked. Without the
above code Blogger saves my template.

How would you write this loop.

Thanks,
Jim
 
T

Thomas 'PointedEars' Lahn

Randy said:
Thomas 'PointedEars' Lahn said the following on 11/14/2007 3:58 PM:

The validator doesn't validate script blocks. The only thing it would
have complained about was the language attribute, the lack of a closing
quote, neither of which would solve the problem.


Again, irrelevant. But, you seem to like posting URL's to documents that
are irrelevant to the current topic.

Read <and
<think about it,
read the above again, think about it, and then shut up.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Randy said:
Thomas 'PointedEars' Lahn said the following on 11/14/2007 8:08 PM:

No matter how many times I "think about it" or "read the above again",
it won't change the fact that your reply was useless and irrelevant.

Now, had you bothered to even come close to answering the question, well
it would change some things.

I could explain it to you, but you would not understand.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top