toSource.js
|
toSource | |
This library is deprecated. Please use the rewrite toLiteral.
Description: UsageThis library comes in handy for communication between server- and client-side ASP (assuming you use javascript serverside). /*ASP with Javascript*/ var str='I\'m creating a string\nwith escape codes.'; Response.Write('var str='+toSource(str)+';\n'); You can use this lib as a light-weight, low-end browser replacement for XML. With javascript, you create a datastructure of arrays/objects that contain strings and nubmers. This structure can be accessed programmatically. For example, implement a client-side only photo-album. You can use this library to scan all pictures on width and height and write those values into the javascript structure. Live DemoThis example loads the javascript-structure, which I use to build up the menu on the left. Press load to load the URL pointing to javascript code, and convert the variable named in the 2nd textbox into a literal. History
After I got the idea, and programmed the biggest part, I found out, Netscape already has native support
for this functionality.
Netscape Javascript has the method |