Connecting Tech Pros Worldwide Forums | Help | Site Map

Blogger template rejects javascript loop

Jim
Guest
 
Posts: n/a
#1: Nov 14 '07
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.



nolo contendere
Guest
 
Posts: n/a
#2: Nov 14 '07

re: Blogger template rejects javascript loop


On Nov 14, 4:43 pm, "Jim" <jc...@NOJUNKMAILsbcglobal.netwrote:
Quote:
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?

nolo contendere
Guest
 
Posts: n/a
#3: Nov 14 '07

re: Blogger template rejects javascript loop


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

Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#4: Nov 14 '07

re: Blogger template rejects javascript loop


Thomas 'PointedEars' Lahn wrote:http://www.jslint.com/
Jim
Guest
 
Posts: n/a
#5: Nov 14 '07

re: Blogger template rejects javascript loop


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" <simon.chao@fmr.comwrote in message
news:1195073878.586520.45150@o38g2000hse.googlegro ups.com...
Quote:
On Nov 14, 4:43 pm, "Jim" <jc...@NOJUNKMAILsbcglobal.netwrote:
Quote:
>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?
>

Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#6: Nov 15 '07

re: Blogger template rejects javascript loop


Randy Webb wrote:
Quote:
Thomas 'PointedEars' Lahn said the following on 11/14/2007 8:08 PM:
Quote:
>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
Randy Webb
Guest
 
Posts: n/a
#7: Nov 15 '07

re: Blogger template rejects javascript loop


Thomas 'PointedEars' Lahn said the following on 11/15/2007 5:10 AM:
Quote:
Randy Webb wrote:
Quote:
>Thomas 'PointedEars' Lahn said the following on 11/14/2007 8:08 PM:
Quote:
>>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/
Closed Thread