{"id":671,"date":"2012-12-08T07:49:39","date_gmt":"2012-12-08T07:49:39","guid":{"rendered":"http:\/\/codeatelier.wordpress.com\/?p=400"},"modified":"2018-02-06T09:16:34","modified_gmt":"2018-02-06T09:16:34","slug":"how-to-escape-single-quotes-in-javascript","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/how-to-escape-single-quotes-in-javascript\/","title":{"rendered":"How to escape single quotes in javascript"},"content":{"rendered":"<pre>\r\n $strLocation = 'http:\/\/www.google.com';\r\n $strLink = \"<span>HI there<\/span>\";\r\n (or)\r\n $strLink = '<span>HI there<\/span>';\r\n\r\n print $strLink;   \r\n<\/pre>\n<p>Using &#039; is html special char which remains undetected during string operations and will appear only in browser.<\/p>\n<p>Using  simple escapes the string <\/p>\n","protected":false},"excerpt":{"rendered":"<p>$strLocation = &#8216;http:\/\/www.google.com&#8217;; $strLink = &#8220;HI there&#8221;; (or) $strLink = &#8216;HI there&#8217;; print $strLink; Using &#039; is html special char which remains undetected during string operations and will appear only in browser. Using simple escapes the string<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-671","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=671"}],"version-history":[{"count":2,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/671\/revisions"}],"predecessor-version":[{"id":714,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/671\/revisions\/714"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}