On Friday 10 February 2006 15:05, Robin Haswell wrote:
> Oh I see. How interesting. Eval scares me heh. Well in which case you'd
> have to unit-test JSON vs XML to see which would be quicker. I have a
> feeling it'd be close though, and I know which one I'd pick if that was
> the case.

no need to eval, he's already printing this string into the page where he 
wants the javascript array to be, all the json module I was referring to 
would do would be to convert his array into the string he needs.

Essentially, it would do what he's already doing, but better.

No need for any json parser or whatever in the browser.

Take for example:
<script type="text/javascript">
var myarray = ['bob','larry','frank'];
</script>

or a php example:
<script type="text/javascript">
var myarray = <?php some_json_converter(array("bob","larry","frank")); ?>;
</script>

the above two should produce the exact same code to the browser, aside from 
maybe differences in whitespace.

-Jeremy

-- 
Jeremy Kitchen ++ [EMAIL PROTECTED]

In the beginning was The Word and The Word was Content-type: text/plain
  -- The Word of Bob.

Attachment: pgpA2XPXLISku.pgp
Description: PGP signature

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to