| re: Variables not declared and "undefined" property values
David R wrote:[color=blue]
> 'lo
>
> This one is confusing me, causing 2 separate errors:
>[/color]
[...]
[color=blue]
> And guess what?
>
> It doesn't work! XD
>
> The 2 problems are:
>
> a) The "adsAreDisabled" variable declared and assigned in jscheck.aspx are
> not carried over to GSScripts.js, so it throws an NRE error for the "if
> (adsAreDisabled) {" line. Is there any workaround for this? (To see problem
> #2 just comment out all the "if" and brace lines)[/color]
I can't test this, but it could be that the jscheck.aspx script has not
loaded when your anonymous function is executed (the right hand side
will be evaluated & executed immediately it is parsed, not when the page
has finished loading).
[color=blue]
>
> b) Setting the .InnerHtml property doesn't do anything; I did an "alert (
> strAdsEnabled );" and that worked. But when I did "alert (
> ulEx.InnerHtml );" I got "undefined". However, "alert ( ulEx );" works fine.[/color]
JavaScript is case sensitive: the property you seek is elEx.innerHTML
(lower case 'i').
--
Rob |