{"action":"created","issue":{"url":"https://api.github.com/repos/brainfoolong/cryptojs-aes-php/issues/6","labels_url":"https://api.github.com/repos/brainfoolong/cryptojs-aes-php/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/brainfoolong/cryptojs-aes-php/issues/6/comments","events_url":"https://api.github.com/repos/brainfoolong/cryptojs-aes-php/issues/6/events","html_url":"https://github.com/brainfoolong/cryptojs-aes-php/issues/6","id":103976041,"number":6,"title":"Getting error on  parsing JSON from php file","user":{"login":"alaksandarjesus","id":4712552,"avatar_url":"https://avatars.githubusercontent.com/u/4712552?v=3","gravatar_id":"","url":"https://api.github.com/users/alaksandarjesus","html_url":"https://github.com/alaksandarjesus","followers_url":"https://api.github.com/users/alaksandarjesus/followers","following_url":"https://api.github.com/users/alaksandarjesus/following{/other_user}","gists_url":"https://api.github.com/users/alaksandarjesus/gists{/gist_id}","starred_url":"https://api.github.com/users/alaksandarjesus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alaksandarjesus/subscriptions","organizations_url":"https://api.github.com/users/alaksandarjesus/orgs","repos_url":"https://api.github.com/users/alaksandarjesus/repos","events_url":"https://api.github.com/users/alaksandarjesus/events{/privacy}","received_events_url":"https://api.github.com/users/alaksandarjesus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-31T02:45:53Z","updated_at":"2015-09-01T18:37:39Z","closed_at":null,"body":"I am getting JSON error while i pass data from php file.\r\n**HTML**\r\n\r\n       <script src=\"cryptojs-aes-php-master/example/aes.js\"></script>\r\n      <script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js\"></script>\r\n      <script src=\"cryptojs-aes-php-master/aes-json-format.js\"></script>\r\n\r\n**PHP File**\r\n\r\n    $encodeanswer[]=htmlentities(cryptoJsAesEncrypt($answer,\"123\"))\r\n**JS File**\r\n\r\n    console.log(value);\r\n                \r\n //{&quot;ct&quot;:&quot;9i4gxztr7W7W0sPFKo1SKA==&quot;,&quot;iv&quot;:&quot;5fba99d002577c64ce4421a979d49f40&quot;,&quot;s&quot;:&quot;fe836ae24c8ca962&quot;}\r\n\r\n    var parsedvalue = value.replace(/&quot;/g,'\"')\r\n    console.log(parsedvalue);\r\n//{ ct: \"nPR3gyDA5Q6Qra1Py9GtAA==\", iv: \"7e10905af0f4d0ba3fb2cfeb5d77ae8e\", s: \"ee20cfb01b5b25b6\" }\r\n    \r\n    console.log(JSON.parse(CryptoJS.AES.decrypt(parsedvalue,\"123\", {format: CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)));\r\n //SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data\r\n\r\nNote: I tested your example and it populating data in input box.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/brainfoolong/cryptojs-aes-php/issues/comments/136822752","html_url":"https://github.com/brainfoolong/cryptojs-aes-php/issues/6#issuecomment-136822752","issue_url":"https://api.github.com/repos/brainfoolong/cryptojs-aes-php/issues/6","id":136822752,"user":{"login":"alaksandarjesus","id":4712552,"avatar_url":"https://avatars.githubusercontent.com/u/4712552?v=3","gravatar_id":"","url":"https://api.github.com/users/alaksandarjesus","html_url":"https://github.com/alaksandarjesus","followers_url":"https://api.github.com/users/alaksandarjesus/followers","following_url":"https://api.github.com/users/alaksandarjesus/following{/other_user}","gists_url":"https://api.github.com/users/alaksandarjesus/gists{/gist_id}","starred_url":"https://api.github.com/users/alaksandarjesus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alaksandarjesus/subscriptions","organizations_url":"https://api.github.com/users/alaksandarjesus/orgs","repos_url":"https://api.github.com/users/alaksandarjesus/repos","events_url":"https://api.github.com/users/alaksandarjesus/events{/privacy}","received_events_url":"https://api.github.com/users/alaksandarjesus/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T18:37:39Z","updated_at":"2015-09-01T18:37:39Z","body":"Hi. Thanks for reply. I cleared off the error.  I  php file its key and phrase and js file its phrase and key. Why this jnverted combination? \n\nAlaksandar\n+91-9952762769\n\nFrom:\"Roland Eigelsreiter\" <notifications@github.com>\nDate:Mon, 31 Aug, 2015 at 10:38\nSubject:Re: [cryptojs-aes-php] Getting error on parsing JSON from php file (#6)\n\nRemote htmlentities and value.replace and it will work. Your pasted console.log output also is not correct, it doesn't show the htmlentites encoded string.\n\n—\nReply to this email directly or view it on GitHub.￼\n\n"}}