Correct quote escaping in href for javascript in WO 5.4

From: Brendan Duddridge (brenda..lickspace.com)
Date: Mon Oct 29 2007 - 19:32:20 EDT

  • Next message: Mike Schrag: "Re: Correct quote escaping in href for javascript in WO 5.4"

    Hi,

    In WOLips on Leopard, I turned on the WO 5.4 validation. Now on my
    components that have inline javascript, I get an error: "The character
    ''' must be escaped"

    Here is a sample bit of HTML:

    <a href="#" onclick="itemView.activateTab('tab1');
    itemView.findProductMatches();">Matches</a>

    I'm not sure if I should be using &quote; or not to properly escape
    the single quotes. After all, WO templates in WO 5.4 now need to be
    valid XML documents as far as I know. I've already been converting all
    my <br> tags to <br /> to clean things up.

    I tried backslash quote ( \' ), but it didn't make the validator
    happy. So what is the correct syntax?

    This syntax does validate, but I'm just wondering if it's correct:

    <a href="#" onclick="itemView.activateTab(&quot;tab1&quot;);
    itemView.findProductMatches();">Matches</a>

    Will WO properly render the page with the quotes unescaped so the
    javascript will function properly at display time?

    Thanks,

    ____________________________________________________________________
    Brendan Duddridge | CTO | 403-277-5591 x24 | brenda..lickspace.com

    ClickSpace Interactive Inc.
    Suite L100, 239 - 10th Ave. SE
    Calgary, AB T2G 0V9

    http://www.clickspace.com





    This archive was generated by hypermail 2.0.0 : Mon Oct 29 2007 - 19:33:26 EDT