0

Incorrect parsing on JavaScript escaped doubles quotes within double quotes

(This post follows http://developer.yahoo.net/forum/index.php?showtopic=1710)

If you try to workaround using

CODE
buffer.push("<img src=\"", state.suggestions[i].companyIconUrl, '">');


the parse is happy but silently strips " src" resulting in the incorrect HTML

CODE
<img="theUrlHere">


which then fails with a cryptic "d is null" error.

Jules

PS:

For those who hit this bug as well, the workaround is

CODE
buffer.push('<img',' src=',"\"", state.suggestions[i].companyIconUrl, '">');

by
0 Replies
  • Thank you for posting this workaround - these are always helpful for the community.

    - Jon

    QUOTE (Julien @ Jun 1 2009, 10:36 PM) <{POST_SNAPBACK}>
    (This post follows http://developer.yahoo.net/forum/index.php?showtopic=1710)

    If you try to workaround using

    CODE
    buffer.push("<img src=\"", state.suggestions[i].companyIconUrl, '">');


    the parse is happy but silently strips " src" resulting in the incorrect HTML

    CODE
    <img="theUrlHere">


    which then fails with a cryptic "d is null" error.

    Jules

    PS:

    For those who hit this bug as well, the workaround is

    CODE
    buffer.push('<img',' src=',"\"", state.suggestions[i].companyIconUrl, '">');
    0

Recent Posts

in YAP