0
$line=htmlentities(stripslashes($line));

This is the normal PHP statement. Can anyone tell me the Syntax in javascript to perform the above task through javascript??

Piyush aggarwal
  • 750
  • 2
  • 14
  • 25

1 Answers1

2

There is a library for this. It has an equivalent to PHP htmlentities function: http://phpjs.org/functions/htmlentities/

cclerv
  • 2,921
  • 8
  • 35
  • 43
  • Thanks @cclerville I found htmlspecialcharacters js on the same website suggected by you.. and it's worksing perfectly. http://phpjs.org/functions/htmlspecialchars/ – Piyush aggarwal Mar 06 '13 at 17:59