469,602 Members | 1,962 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

Blogger template rejects javascript loop

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.
Nov 14 '07 #1
6 3481
On Nov 14, 4:43 pm, "Jim" <jc...@NOJUNKMAILsbcglobal.netwrote:
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?

Nov 14 '07 #2
On Nov 14, 4:43 pm, "Jim" <jc...@NOJUNKMAILsbcglobal.netwrote:
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.

Nov 14 '07 #3
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

"nolo contendere" <si********@fmr.comwrote in message
news:11*********************@o38g2000hse.googlegro ups.com...
On Nov 14, 4:43 pm, "Jim" <jc...@NOJUNKMAILsbcglobal.netwrote:
>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?

Nov 14 '07 #5
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 11/14/2007 8:08 PM:
>think about it, read the above again, think about it, and then shut up.

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
Nov 15 '07 #6
Thomas 'PointedEars' Lahn said the following on 11/15/2007 5:10 AM:
Randy Webb wrote:
>Thomas 'PointedEars' Lahn said the following on 11/14/2007 8:08 PM:
>>think about it, read the above again, think about it, and then shut up.
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.
You are a pathetic excuse sometimes.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 15 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Sebastian Faust | last post: by
3 posts views Thread by Gianni Mariani | last post: by
6 posts views Thread by Mike Alexeev | last post: by
11 posts views Thread by Johan | last post: by
1 post views Thread by Kai-Uwe Bux | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.