Andrew Rhyne
Andrew Rhyne

Reputation: 5090

AngularJS JSON Compression

I am trying to figure out a way to pipe a compressed JSON string from the server to the front end. On the backend, I am simply using gzcompress to compress the returned string from json_encode. Is there a javascript function that can uncompress a string that was compressed using gzcompress?

Upvotes: 0

Views: 1627

Answers (1)

Nisreen KH
Nisreen KH

Reputation: 90

To uncompress and run this code on client side, the following code has to be included in the HTML code:

<script src="./jsxcompressor.js" type="text/javascript"></script>
<script type="text/javascript">
eval(JXG.decompress(jxgcompressed));
</script>

see this link gc compressed

Upvotes: 1

Related Questions