The following code is an example of creating global variables from within a Javascript function:

function setValue() { window.myValue = “test”; } function getValue() { alert(window.myValue); // “test” (assuming setValue has run) }

Global Variables in JavaScript – Snook.ca.

Be Sociable, Share!

Subscribe to comments Comment | Trackback |
Post Tags: ,

Browse Timeline


Add a Comment


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

Powered by WP Hashcash


© Copyright 2007 KafeKafe . Thanks for visiting!