~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/common/util.js

  • Committer: mattgiuca
  • Date: 2008-01-13 23:46:20 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:214
util.js: Added 'repr' function.
browser, listing.js: Use repr to generate correct strings to pass to functions
inline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
469
469
    return str.substr(str.length - substring.length) == substring;
470
470
}
471
471
 
 
472
/** Equivalent to Python's repr.
 
473
 * Gets the JavaScript string representation.
 
474
 * Actually just calls JSON.stringify.
 
475
 */
 
476
function repr(str)
 
477
{
 
478
    return JSON.stringify(str);
 
479
}
 
480
 
472
481
/** Makes an XMLHttpRequest call to the server. Waits (synchronously) for a
473
482
 * response, and returns an XMLHttpRequest object containing the completed
474
483
 * response.