File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Script - Problem When data has apostrophe

 
Madhumathy Viswanathan
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a link which calls the javascript function. This link passes a String (which has an apostrophe)as an input to the script. At this point, the javascript function is not called.If the input String to javascript function does not have apostrophe , then the method is called successfully!!

Kindly help me out how to handle inputs with apostrophe

Thanks in advance
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It needs to be escaped "\" so it does not affect the string.

Eric
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried escaping the apostrophes, writing 'abc\"def" instead of 'abc"def'? It would be a good idea to do that for single quotes as well.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic