HELP: Tricky display...

Posted on 2006-04-12
Last Modified: 2010-04-01
Note original post wi. right formating may be found here:,15879283

Hmmm what work around could you think of where:

by calling a JSP tag:
<c:out value="${item.title}">[/code]
what becomes:
The "special" season has arrived.[/code]
As you can see the title has double quotes in them;
However the double quotes are transformed into:
the " - double quotation mark
but that still makes a JavaScript fail when used like so:
<a href=# onclick='javascript=alert("<c:out value="${item.title}">");'>onclick avascript alert</a>
as it becomes:
<a href=# onclick='javascript=alert("The &#34;special&#34; season has arrived.");'>onclick avascript alert</a>
what fails
Idealy we would have:
<a href=# onclick='javascript=alert("The \"special\" season has arrived.");'>onclick avascript alert</a>
but I do not have control over what
<c:out value="${item.title}">
returns (it's just a functionality give to me)[/code]
What do you think would be a good work around to make the tag work inside of a JavaScript...

Any tips, tricks, links, suggestions are much appreciated ;)

<I>Thank you all...</I>
Question by:InGearX
    1 Comment
    LVL 35

    Accepted Solution


    Seems to show that you can use a DIV and innerHTML to get these codes converted to their real chars...

    I would probably try to avoid using alert() as it never looks nice

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    It Is not possible to enable LLDP in vSwitch(at least is not supported by VMware), so in this article we will enable this, and also go trough how to enabled CDP and how to get this information in vSwitches and also in vDS.
    Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now