IE JScript Error "Expected Identifier"; What does it actually mean?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikr
    New Member
    • May 2010
    • 1

    #1

    IE JScript Error "Expected Identifier"; What does it actually mean?

    I'm new to jquery, and hoping it will make my client side coding more friendly (particularly with regards to ie).
    As is usually the case, I've got some code that works nicely in ff, but kicks out an "Expected Identifier" error.
    So, I've got two questions:
    1. What exactly does that mean? What is an "Identifier ," particularly within the context of Internet Explorer and JScript?
    2. Why am I getting it? The code that is producing the error is below:

    Code:
    $.getJSON('pages.json.php', function(data) {
            var myLive = " ";
            var myDelete = " ";
            var html = "";
            for (var i=0; i<data.sections.length; i++) {
    
                if (!data.sections[i].golive.length) {
    
                } else {
                    myLive = '<a href="#" onclick="$(\'#';
                    // Code breaks on the above line
                    ...
                }
                ...
            }
            ...
    });
    The above code is part of an anonymous function that gets called by $.getJSON('.... ', function(data){ ...}). I do declare myLive as local within that function: var myLive = "&nbsp;";
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    It looks like you're doing some funky quotations there.
    myLive = '<a href="#" onclick="$(\'#' ;
    I cannot even figure out what you are shooting for with that string.

    Comment

    Working...