Problem with "this" reference for the AOL browser

D

David Graham

I looked in this newsgroup and I could not find a similiar post.
My issue is I have a javascript function.
function subImageWaitNav(value0,value1, value2)
{
value0.src = preLoadImageWait.src;

if (hasSubmitted==false)
{
hasSubmitted = true;
value0.cursor = 'wait';
DisableEdits(value1);
SubmitForm(value2);
}
}

I then call this function with
onclick="subImageWaitNav(this,True,'nameOfForm');"
It works fine with all our browser testing, btu not AOL version 8?
Does anyone have an idea what the issue is, or a better way? This
function is called from numerous image buttons and basically displays
a please wait image where the button was, and also disables the
button.
Thank you.
 
L

Lee

David Graham said:
I looked in this newsgroup and I could not find a similiar post.
My issue is I have a javascript function.
function subImageWaitNav(value0,value1, value2)
{
value0.src = preLoadImageWait.src;

if (hasSubmitted==false)
{
hasSubmitted = true;
value0.cursor = 'wait';
DisableEdits(value1);
SubmitForm(value2);
}
}

I then call this function with
onclick="subImageWaitNav(this,True,'nameOfForm');"
It works fine with all our browser testing, btu not AOL version 8?
Does anyone have an idea what the issue is, or a better way? This
function is called from numerous image buttons and basically displays
a please wait image where the button was, and also disables the
button.

What doesn't work? Does it fail to assign the new src,
or is it just that the AOL browser (like many others) doesn't
give any significance to your adding a new attribute named
"cursor" to an Image?

Have you alerted the value of "value0" to see what's being
passed in?

You seem to be passing a variable named True. Why not use
the predefined keyword "true"?

The parameter names "value0", "value1", and "value2" are bad
choices. Why not "imgRef", "disableChoice", and "formName"?
 
T

Thomas 'PointedEars' Lahn

David said:
I looked in this newsgroup and I could not find a similiar post.
My issue is I have a javascript function.
function subImageWaitNav(value0,value1, value2)
{
value0.src = preLoadImageWait.src;

You should avoid referring to global variables, pass a
reference to or value of it as function argument instead.
if (hasSubmitted==false)

If `hasSubmitted' refers to a boolean value or a value that can be
reasonably converted to a boolean, it is not necessary to compare
with the `false' (or `true') value. Just write

if (!hasSubmitted)

for the equivalent or

if (hasSubmitted)

for its counterpart. See the FAQ.
{
hasSubmitted = true;
value0.cursor = 'wait';
DisableEdits(value1);
SubmitForm(value2);
}
}

Your code could use more indentation.
I then call this function with
onclick="subImageWaitNav(this,True,'nameOfForm');"
It works fine with all our browser testing,

If the used script engine is an ECMAScript compliant engine, this cannot be.
ECMAScript and its implementations are case-sensitive about identifiers.
The value is `true', not `True'.

What is `this', i.e. what type of element object are you referring to?
What is 'nameOfForm' referring to?
What will users of a UA experience if that software does not provide
support for client-side scripting (for whatever reason conceivable)?
btu not AOL version 8?

"Does not work" is a useless error description. [psf 4.11]
Read the FAQ on how to get useful error messages.

Have you declared the default scripting language to be used
in intrinsic event handler attribute values?

<meta http-equiv="Content-Script-Type" content="text/javascript">


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top