• Resolved aebar

    (@aebar)


    Hi,

    I have an issue when trying to escape the double quote in the following code:
    <a href="javascript:void(0)" onClick="document.querySelectorAll('[href=\"#tabs_desc_1562_2\"]')[0].click();"><strong>Visitez l'encart "Mon estimation personnalisée"</strong></a>

    I get the error:

    Warning: Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/tabs-responsive/ink/admin/add-tabs.php on line 23

    And all my tabs disappear, so I have to build them again.

    I’ve also tried with:

    <a href="javascript:void(0)" onClick="document.querySelectorAll('[href=\x22#tabs_desc_1562_2\x22]')[0].click();"><strong>Visitez l'encart "Mon estimation personnalisée"</strong></a>

    Same result.

    Thanks.

    Regards

    • This topic was modified 9 years, 6 months ago by aebar.
    • This topic was modified 9 years, 6 months ago by aebar.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter aebar

    (@aebar)

    I tried also a workaround :
    <a href="javascript:void(0)" onClick="document.querySelectorAll('[href=& #034;#tabs_desc_1562_2& #034;]')[0].click();"><strong>Visitez l'encart "Mon estimation personnalisée"</strong></a></p>

    It works, but only one time. If I edit the tabs and update it, the browser is not able to interpret correctly the javascript code since the double quotes are not escaped anymore.

    • This reply was modified 9 years, 6 months ago by aebar.
    • This reply was modified 9 years, 6 months ago by aebar.
    • This reply was modified 9 years, 6 months ago by aebar.
    Thread Starter aebar

    (@aebar)

    Another workaround that works this time 🙂

    <script>
    function toEstimationTab(){
    document.querySelectorAll('[href="#tabs_desc_1562_2"]')[0].click();}
    </script>
    <a href="javascript:void(0)" onClick="toEstimationTab();"><strong>Visitez l'encart "Mon estimation personnalisée"</strong></a>

    By the way, this used to switch from one tab to another through a link, maybe it would be useful for other people.

    • This reply was modified 9 years, 6 months ago by aebar.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug when escape character in description’ is closed to new replies.