You can use this function to test if a variable exists:

function checkExists(testVar) {
  if (typeof(window[testVar]) == "undefined" ) {
    return false;
  } else {
    return true;
  }
}

Usage:
if (checkExists("myvar1")) {
  // do this
} else {
  // do that
}

Morg wrote:
Does anyone know how to do a cfparam or isDefined in javascript?


-- Regards: Ayudh

+----------------------------------------------------------------+
| SOAP is the glue! Hook up your server directly to your bank.   |
| Connect to VeriPay xServ, the Australian Payments Web Service. |
| Reliable, Secure, FAST: http://www.xilo.com/xserv              |
+----------------------------------------------------------------+


--- You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to