Forums »
  Javascipt Forums And Other Related Topics Discussion About Javascript Progamming »
    How To Escape Html Characters In Javascript For Eval()

How To Escape Html Characters In Javascript For Eval()

Description: this is how i was able to overcome and fix trying to use HTML characters while sending it to the eval function in javascript
Tags: computer ,programming ,web ,php ,javascript
Posted On Sun Apr 22, 2012 By hostman In Javascipt Forums And Other Related Topics Discussion About Javascript Progamming Forums
today i was working on a script which required me to run some html code but i was using the eval() function in javascript and jquery to execute the command. i tried several things..

i tried using the backlash \\ - that didint work

if you go to http://stackoverflow.com/questions/3830163/how-to-escape-special-characters-within-eval-using-javascript
it tells u to use " instead of \\"
i tried using " instead of \\" but that only worked on Firefox and Chrome, but not Internet Explorer

so what finally worked? well, i was using php to generate the HTML code so i simple used the function, and it coverted all the HTML code to be used by the eval() function in javascript.

hope that helps anyone
Information
Title: How To Escape Html Characters In Javascript For Eval()
Info: This Post Has Been Viewed 0 Times Since
Date: Sun Apr 22, 2012
Author hostman Received 0 Replies #846
Related Sites
Add Your Website
Share
wallpaperama | Wallpapers | Forums | Terms Of Service

copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Wed Jun 19, 2013 (-8 GMT)
Powered by: Webune Forums V5