2 messages in com.googlegroups.google-mashup-editor[gme] Can someone please provide a JS...
FromSent OnAttachments
Ray12 Jun 2008 16:08 
Jason16 Jun 2008 10:36 
Subject:[gme] Can someone please provide a JSON example that works
From:Ray (rayc@gmail.com)
Date:06/12/2008 04:08:20 PM
List:com.googlegroups.google-mashup-editor

Hi,

I have struggled incorporating any significant Javascript code including JSON calls inside of GME. The compiler throws errors on Javascript code that works outside of GME. Errors usually are related to syntax and URL encoding. For instance, it appears the compiler does not like embedded "_" and ">" or "<". In one example I got the line to compile when I changed "_" to %26.

Considering functional Javascript is critical for any serious development I am concerned GME is not ready for prime time.

Here is an example of a very simple JSON example that fails in GME. If would be great if someone can get this code (or any Javascript that loops through the DOM) to work. Thanks.

<gm:page title="My App" authenticate="false">

<script type="text/javascript">

function pipeCallback(obj) { document.write("<div><h3>Items for Sale on eBay</h3>"); var x; for (x = 0; x < obj.count ; x++) { var buildstring = "<b><a href=" + obj.value.items[x].link + ">" + obj.value.items[x].title + "</a></b>. <span id=desc>" + obj.value.items[x].description + "</span><br />";

document.write(buildstring); buildstring = null; }

document.write("</div>"); }

</script>

<p><span>This Page authored by <strong>Tony Loton</strong> for the book </span> <span> <a target="_blank" href="http://www.lotontech.com/it_books.htm">Mashup Case Studies with Yahoo! Pipes</a></span><span class="style3"> published by <strong>LOTONtech Limited</strong></span><span class="style1">.</ span></p>

<script type="text/javascript" src="http://pipes.yahoo.com/pipes/ pipe.run? _id=pKarhVrr3BGtEAZ4jknRlg&_render=json&_callback=pipeCallback"> </script>

</gm:page>