<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=utf-8"></HEAD><BODY><br>No, I didn't say that. <div><br></div>I am building a Cordova app for an Android tablet. This comprises an html file along with an attendant js file.<div><br></div>The Javascript page is making a REST GET request back to a Seaside server (on a remote Windows Server node). What that gets is an HTML response as mentioned earlier. This HTML response includes a JSON with the data. The Javascript on the Android device then parses out the JSON.<div><br></div><div><br></div>What I wanted to do was for Seaside to only send the JSON as a response to the GET request to save doing the little bit of parsing but the Seaside solution is more complex than the 5 line JS so I will go with the JS. This is all part of an Open University project. These is only a single GET call (that sends varying parameters so varying data responses) so this little bity of code is only required in one place.<br><br>--------- Original Message ---------<br><b>From:</b> "Johan Brichau" <johan@inceptive.be><br><b>To:</b> "David Pennington" <david@totallyobjects.com>, "Seaside - general discussion" <seaside@lists.squeakfoundation.org><br><b>Subject:</b> Re: [Seaside] seaside Digest, Vol 175, Issue 6<br><b>Date:</b> 07/10/2017 19:38:11 (Mon)<br><br>Are you seriously generating html and then splicing out the generated javascript on the client side?<div class=""><div class=""><div class=""><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 10 Jul 2017, at 17:26, David Pennington <<a href="mailto:david@totallyobjects.com" class="" target="_blank">david@totallyobjects.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Thanks for the advice however, I always find responses like this outside of my capabilities due to my lack of in-depth knowledge of Seaside.<div class=""><br class=""></div>In fact, I solved my problem quite simply by writing a few lines of JavaScript as follows:<div class=""><br class=""></div><div class=""><br class=""></div><div class="">var first = data.indexOf("{");</div><div class="">var next = data.indexOf("}");</div><div class="">userJson = data.slice(first,next + 1);</div><div class="">userJson = userJson.replace(/"/g, '\"');</div><div class="">userJson = userJson.replace(/;/g, '');</div><div class="">return $.parseJSON(userJson)</div><br class="">where the $.parseJSON is a jquery.mobile.js method.<div class=""><br class=""></div>This worked perfectly and I now have a fully organised JavaScript object that has the parsed JSON.<div class=""><br class=""></div>David<br class="">--------- Original Message ---------<br class=""><b class="">From:</b> <<a href="mailto:seaside@lists.squeakfoundation.org" class="" target="_blank">seaside@lists.squeakfoundation.org</a>><br class=""><b class="">To:</b> <<a href="mailto:seaside@lists.squeakfoundation.org" class="" target="_blank">seaside@lists.squeakfoundation.org</a>><br class=""><b class="">Subject:</b> seaside Digest, Vol 175, Issue 6<br class=""><b class="">Date:</b> 07/10/2017 13:00:07 (Mon)<br class=""><br class=""><pre style="white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; word-wrap:break-word;" class="">Send seaside mailing list submissions to
        <a href="mailto:seaside@lists.squeakfoundation.org" class="" target="_blank">seaside@lists.squeakfoundation.org</a>

To subscribe or unsubscribe via the World Wide Web, visit
        <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" class="" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
or, via email, send a message with subject or body 'help' to
        <a href="mailto:seaside-request@lists.squeakfoundation.org" class="" target="_blank">seaside-request@lists.squeakfoundation.org</a>

You can reach the person managing the list at
        <a href="mailto:seaside-owner@lists.squeakfoundation.org" class="" target="_blank">seaside-owner@lists.squeakfoundation.org</a>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of seaside digest..."

</pre>

<br class="">
<br class="">
<hr class="">
<br class="">
<pre style="white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; word-wrap:break-word;" class="">Today's Topics:

   1. Removing HTTP headers (David Pennington)
   2. Re: Removing HTTP headers (Philippe Marschall)

</pre>

<br class="">
<br class="">
<hr class="">
<br class="">
<pre style="white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; word-wrap:break-word;" class="">_______________________________________________
seaside mailing list
<a href="mailto:seaside@lists.squeakfoundation.org" class="" target="_blank">seaside@lists.squeakfoundation.org</a>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" class="" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>

</pre>
</div>
<br class=""><hr class=""><pre class="">Message sent using Winmail Mail Server</pre>
_______________________________________________<br class="">seaside mailing list<br class=""><a href="mailto:seaside@lists.squeakfoundation.org" class="" target="_blank">seaside@lists.squeakfoundation.org</a><br class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br class=""></div></blockquote></div><br class=""></div></div></div></div>
</BODY></HTML>
<br><hr><pre>Message sent using Winmail Mail Server</pre>