• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quote kills nifty description field in javascript, how to prevent?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quote kills nifty description field in javascript, how to prevent?


  • Subject: Re: Quote kills nifty description field in javascript, how to prevent?
  • From: Johan Henselmans <email@hidden>
  • Date: Thu, 20 Oct 2011 15:16:59 +0200


On Oct 20, 2011, at 2:09 PM, Kieran Kelleher wrote:

Hi John,

Any reason why you would not use a WOGenericContainter for the 'a' element and provide bindings that way, with logic, such as StringEscapeUtils.escapeJavaScript(..) that escapes the title text?


Perhaps because I did not know of such a possibility? 

Thanks for the tip, I will try to find out the right incantation. If I am not here the coming days, you know why that is.

35 minutes round trip BTW, do not ever do that again. Post your answer but send it of with a default timelag of at least 8 hours. Otherwise people might start to rely on the Kelleher Quick Response Task Force. 


BTW, StringEscapeUtils.escapeJavaScript(..) resides in Wonder/ERJars/commons-lang-2.5.jar

Regards, Kieran



On Oct 20, 2011, at 7:45 AM, Johan Henselmans wrote:

I had a nice website that displays pictures, and as it happens to be thee are of course some quotes and double quotes involved. I noticed at a certain moment that the stuff I did (it's a google map with markers) did not display any more. 

I first thought it was caused by the intertubes, but apparently somebody had put a quote in the description which caused the _javascript_ to fail. 

this is the resulting HTML :

	google.maps.event.addListener(marker0, 'click', function() {
//  	 $("a[rel=marker0]").fancybox(

  	 $.fancybox( [

  	 { "href": "/PH/digitalassets/2/6/c/92.jpg", "title": "From Idan York @ chiuki.com: Rowing on the Nieuwe Prinsengracht at the Onbekendegracht toward the Amstel, beside Carre' Theatre, the Sluises and the Magerebrug."} ,

  	 ],
The quote in the title field, before Theatre, is causing mayhem for the _javascript_.

So my humble question is: how do I prevent the quote that is in the description field of the record to be displayed as a quote? I thought I could get away with escapeHTML=YES, but that did not change the outcome. Here is my current code:

<a rel="marker<wo:WOString value = "$counter"/>" href="<wo:WOString value ="$tmpPicture.pictureattachment.webPath"/>" title="<wo:WOString value ="$tmpPicture.description" escapeHTML=YES/>" ></a>


Johan Henselmans
email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Framework Not Building In Hudson/Jenkins (From: Ted Archibald <email@hidden>)
 >Re: Framework Not Building In Hudson/Jenkins (From: Ray Kiddy <email@hidden>)
 >Quote kills nifty description field in javascript, how to prevent? (From: Johan Henselmans <email@hidden>)
 >Re: Quote kills nifty description field in javascript, how to prevent? (From: Kieran Kelleher <email@hidden>)

  • Prev by Date: Re: Quote kills nifty description field in javascript, how to prevent?
  • Next by Date: no object DCH for MIME type application/pdf
  • Previous by thread: Re: Quote kills nifty description field in javascript, how to prevent?
  • Next by thread: Embed a external command-line tool in bundle
  • Index(es):
    • Date
    • Thread