[Greasemonkey] All GM user script variables
Bill Donnelly
donnelly at snowcrest.net
Wed Apr 12 15:03:57 EDT 2006
If you are looking for KNOWN value names, then you can always
look for the value and see if it is defined yet, or not.
I think the way to do it is to use the eval() function.
Here is how I tested it using the Javascript Shell bookmarklet:
u_1="yes"
yes
u_3=34
34
typeof (u_1)
string
typeof (u_2)
undefined
typeof (u_3)
number
for(ii=1;ii<4;++ii){eval("aa=typeof(u_"+ii+");");print(ii+", "+aa)}
1, string
2, undefined
3, number
Chris McKeever wrote:
> Is there any mechanism to determine all the variables for your particular
> script (as in the case that you are dynamically generating some user stored
> values u_1....u_n ??
>
> thanks
--
Nixon wiretapped the DNC offices. Bush wiretapped the American people.
Bush IS the new Nixon. And a two-time Sore 'Winner'. Impeach Bush!
__The United States is NOT "at War!"__
Do not believe their lies and propaganda. Do not allow them to use this obvious,
blatant excuse against the American people, our freedoms, and our way of life.
Clinton lied and no one died. pResident Gov. Bush lied and thousands died.
Truly support our troops. Bring them home! NOW!
More information about the Greasemonkey
mailing list