473,387 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem with "this" reference for the AOL browser

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.
Jul 23 '05 #1
2 1107
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"?

Jul 23 '05 #2
David Graham wrote:
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
--
Moz, you can't just pick 3.)
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christoph | last post by:
newFieldElement = document.createElement( 'INPUT' ); newFieldElement.onblur = new Function( "calculatePremiumOptionTotal( this );" ); In my (dynamically generated) javascript, I've never had a...
7
by: Daniel Ervi | last post by:
Hi All, I have a question for the group as I can't seem to come up with any suitable solutions. I'm not that new to programming or C#, but neither am I very fluent yet, so I'd appreciate any...
3
by: Jason S | last post by:
I have a rough understanding of what the "this" keyword refers to in Javascript but am not very clear on it. Is there a good reference that explains it well?
8
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I have a large class with a lot of member variables. I also have a function in the class that I would like to change ALL Of the member variables. I am trying to assign...
5
by: DamienS | last post by:
Hi, I have a static method in a class and I need to be able to return a reference to "this". Googling around, I found a heap of discussions of the pros/cons of "abstract static" etc. It was...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.