Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
more useful options
 
PerlMonks  

Re^2: Free Nodelet freed

by cLive ;-) (Prior)
on Oct 14, 2004 at 15:02 UTC ( [id://399296]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Free Nodelet freed
in thread Free Nodelet freed

eval is your friend (using the word friend in its loosest form :)
<script language="javascript"> var arr = new Array('one','two'); var lb = "\x5B"; var rb = "\x5D" var code = "alert(\"Second element is \"+arr"+lb+"1"+rb+")"; eval(code); </script>

:)

cLive ;-)

Replies are listed 'Best First'.
Re^3: Free Nodelet freed
by ikegami (Patriarch) on Nov 02, 2006 at 21:25 UTC
    This might be simpler:
    // Hack around mangling of left square bracket by PerlMonks. function get_item(a, i) { return eval("a\x5Bi]"); } function set_item(a, i, v) { return eval("a\x5Bi] = v"); }
    Usage:
    var a = new Array(5); set_item(a, 2, "Hello World\n"); alert(get_item(a, 2));

    Update: Never mind. New useful escapes documented here.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://399296]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.