Blogger template rejects javascript loop

Discussion in 'Javascript' started by Jim, Nov 14, 2007.

  1. Jim

    Jim Guest

    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.
     
    Jim, Nov 14, 2007
    #1
    1. Advertising

  2. On Nov 14, 4:43 pm, "Jim" <> wrote:
    > 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, Nov 14, 2007
    #2
    1. Advertising

  3. Jim wrote:
    > 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
    --
    Anyone who slaps a 'this page is best viewed with Browser X' label on
    a Web page appears to be yearning for the bad old days, before the Web,
    when you had very little chance of reading a document written on another
    computer, another word processor, or another network. -- Tim Berners-Lee
     
    Thomas 'PointedEars' Lahn, Nov 14, 2007
    #3
  4. On Nov 14, 4:43 pm, "Jim" <> wrote:
    > 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.
     
    nolo contendere, Nov 14, 2007
    #4
  5. Jim

    Jim Guest

    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" <> wrote in message
    news:...
    > On Nov 14, 4:43 pm, "Jim" <> wrote:
    >> 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?
    >
     
    Jim, Nov 14, 2007
    #6
  6. Randy Webb wrote:
    > Thomas 'PointedEars' Lahn said the following on 11/14/2007 3:58 PM:
    >> http://validator.w3.org/

    >
    > 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.
    >
    >> http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you

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


    Read <news:> and
    <news:CxJ_i.10068$>, think about it,
    read the above again, think about it, and then shut up.


    PointedEars
    --
    var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
    ) // Plone, register_function.js:16
     
    Thomas 'PointedEars' Lahn, Nov 15, 2007
    #7
  7. 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
     
    Thomas 'PointedEars' Lahn, Nov 15, 2007
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    450
  2. Dominic Connor, Pimp

    A Template that rejects classes.

    Dominic Connor, Pimp, May 9, 2007, in forum: C++
    Replies:
    6
    Views:
    295
    James Kanze
    May 10, 2007
  3. Marian Schedenig

    HP LaserJet rejects print jobs

    Marian Schedenig, Aug 9, 2007, in forum: Java
    Replies:
    0
    Views:
    430
    Marian Schedenig
    Aug 9, 2007
  4. helveticus

    Server rejects template script request

    helveticus, Jul 1, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,087
    helveticus
    Jul 2, 2009
  5. Isaac Won
    Replies:
    9
    Views:
    387
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page