I have a server that is responding to a GET and send JSON data. That data contains some html also, and the following piece of code gives me a Uncaught SyntaxError: Unexpected token ILLEGAL
. Now I have seen the multiple posts stating that it could be related to \200B and I think it is.. I have tried this post and I could not find the character.. Can you let me know how I can find and remove this character? This html is coming from a SQL server and I have a lot of data that will have this same string and want to remove it.
Here is the jfiddle that when you run, you get the error.
If I peek into my mssql database (and when I print in console this.model.toJSON().body
), I see the following:
<p>Lorem Ipsum</p>
<p>Lorem Ipsum</p>
<strong>Tweet this article out</strong></span><br><br>
<a href="https://twitter.com/share" class="twitter-share-button" data-text="I 25 by @oberz" data-via="Atdsfm" data-size="large">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\'http\':\'https\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\'://platform.twitter.com/widgets.js\';fjs.parentNode.insertBefore(js,fjs);}}(document, \'script\', \'twitter-wjs\');</script>
<p> More html stuff</p>
Here is what this.model.toJSON()
looks like at the console.. (the body key has the html I listed above):
Object {id: "former-obama-religion-adviser-speaks-at-event", authorbio: "sdflkd", organization_slug: null, body: "*html shown above*", author_image_url: "", cost: ""…}