[Javascript] [Javascript] Re: export variables outside function
wizard@dscript.net.nz
wizard at dscript.net.nz
Fri Jan 3 15:24:59 CST 2003
You make a variable global in JavaScript by declaring it at the root
level. Your code will work if you add:
var windowOpen = |q||q|;
var x_poz = 0;
the line before the function declaration.
I would highly recommend changing the name of the function from open()
(which is already a function built into JavaScript) to something like
winOpen(). This is probably what is causing the problem.
Lew
At 12:01 PM 1/3/2003, you wrote:
>Message: 1
>From: |q|aw|q| <alfwro at wp.pl>
>To: javascript at LaTech.edu
>Date: Thu, 02 Jan 2003 21:04:40 +0100
>Subject: [Javascript] export variables outside function
>Reply-To: javascript at LaTech.edu
>
>Hi,
>I have problem with this function:
>
>function open(cityName) {
>var windowOpen = eval(cityName + |q|Obj|q|);
>windowOpen.visibility = |q|visible|q|
>var x_poz = parseInt(windowOpen.left);
>
>if (x_poz <120) {
>windowOpen.left = x_poz +15;
>setTimeout(|q|open()|q|,1);
>}
>}
>
>So I have two question
>1. How to make it work, or
Lewis A. Shadoff, Ph.D.
Brazosport College
Lake Jackson, TX
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
=======================================
Webmail prototype
by andyg at ihug.co.nz
=======================================
More information about the Javascript
mailing list