473,789 Members | 2,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with ASP.Net object and Javascript

I have a function:

function SalaryDisplay(m e)
{
var salaryMinLabel = document.getEle mentById("Salar yMin");
salaryMinLabel. value = 200;
alert("after setting salaryMinLabel = " + salaryMinLabel. value);
}

I also have an asp.net object:

<asp:label id="SalaryMin" runat="server" />

Which renders into:

<span id="SalaryMin"> </span>

The function seems to find the span fine. The alert box shows that it is
set to 200. But the web page never shows it.

Is there a problem setting the span element?

Thanks,

Tom
Jul 23 '05
54 4615
Ivan Marsh <an*****@you.no w> writes:
There exist bugs in the JavaScript and JScript implementations that
make them non-compliant.


Being non-compliant isn't a bug.


But claiming to be compliant and not being it, suggests that the
noncompliance is due to a bug, not a deliberate choice.

It should be noticed that JScript is not claimed to be compliant:
<URL:http://msdn.microsoft. com/library/en-us/script56/html/js56jsconabout. asp>

Rhino and SpiderMonkey do claim compliance:
<URL:http://www.mozilla.org/js/>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #41
Jim Ley wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Jim Ley wrote:
[...] Richard Cornford [...] wrote:
Thus they are all conforming ECMAScript implementations .
Well there are bugs...

Please be more specific. <------------------------------------------.

|
There exist bugs in the JavaScript and JScript implementations that |
make them non-compliant. |

|
----------------------------------------------------------------------'
PointedEars
--
In the First World War, 13 million people were killed. In the Second
World War, 40 million people were killed. I think that if a third war
takes place, nothing is going to be left on the face of earth.
-- Shakira, 2003-02-05 @ MTV.com
Jul 23 '05 #42
Jim Ley wrote:
Richard Cornford wrote:
Thus they are all conforming ECMAScript
implementatio ns.


Well there are bugs...


Fair enough, they all have minor behaviour that does not strictly
conform with the what is specified in ECMA 262. But it is not the
extensions that are getting in the way of that.

Ricahrd.
Jul 23 '05 #43
Thomas 'PointedEars' Lahn <Po*********@we b.de> writes:
Jim Ley wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Jim Ley wrote:
[...] Richard Cornford [...] wrote:
> Thus they are all conforming ECMAScript implementations .
Well there are bugs...
Please be more specific. <------------------------------------------.

|
There exist bugs in the JavaScript and JScript implementations that |
make them non-compliant. |

|
----------------------------------------------------------------------'


Take arrays, a quite fundamental part of the language:

In IE:
[1,2,3,].length
is 4, it should be 3.

In FireFox:
"1" in [0,,2]
is true, should be false.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #44
>>>>>>Thus they are all conforming ECMAScript implementations .
>
>Well there are bugs...

Please be more specific. <------------------------------------------.

There exist bugs in the JavaScript and JScript implementations that |
make them non-compliant.


Take arrays, a quite fundamental part of the language:

In IE:
[1,2,3,].length
is 4, it should be 3.

In FireFox:
"1" in [0,,2]
is true, should be false.


If I do this with FF 1.02:

var my = [0,,2];
if ( my[1] ) alert('true');
else alert('false');

it displays 'false'
Andrew Poulos
Jul 23 '05 #45
Andrew Poulos schrieb:
>>> Thus they are all conforming ECMAScript implementations .

[...]
In FireFox:
"1" in [0,,2]
is true, should be false.


If I do this with FF 1.02:

var my = [0,,2];
if ( my[1] ) alert('true');
else alert('false');

it displays 'false'


I think this was about the `in' operation.
PointedEars

P.S.
Please provider proper attribution.
Jul 23 '05 #46
Lasse Reichstein Nielsen schrieb:
Ivan Marsh <an*****@you.no w> writes:
There exist bugs in the JavaScript and JScript implementations
that make them non-compliant.


Being non-compliant isn't a bug.


But claiming to be compliant and not being it, suggests that the
noncompliance is due to a bug, not a deliberate choice.

It should be noticed that JScript is not claimed to be compliant:
<URL:http://msdn.microsoft.com/library/en...html/js56jscon
about.asp>

Rhino and SpiderMonkey do claim compliance:
<URL:http://www.mozilla.org/js/>


IBTD:

"with only minor exceptions ..., ... a full implementation" (M$) and
"a superset ... with mild differences" (Mozilla.org) is much the same
to me.
PointedEars
Jul 23 '05 #47
Andrew Poulos <ap*****@hotmai l.com> writes:
Take arrays, a quite fundamental part of the language: ..... In FireFox:
"1" in [0,,2]
is true, should be false.
If I do this with FF 1.02:

var my = [0,,2];
if ( my[1] ) alert('true');
else alert('false');

it displays 'false'


As it should.

The "in" operator takes a string and an object, and gives true
if the object has a property with the name in string. E.g.

var o = {foo:42};
alert(["foo" in o, "bar" in o]);

It alerts "true,false ".

An object might have a property with a value that is "falsey" (converts
to false as a boolean), even "undefined" .

var o = {foo: undefined};
alert(["foo" in o, "bar" in o]);
alert([o["foo"],o["bar"]]);

alerts first "true,false ", then "undefined,unde fined".

There is a difference between not having the property, and having the
property with the value "undefined" , even if attempting to read either
gives the same result (undefined).
The array literal [0,,2] should not have a property called "1"
according to the ECMAScript standard. The error in FireFox/Gecko's
ECMAScript implementation is that that it does, it just has the value
"undefined" . It's a very minor and insignificant error, which is
probably why it hasen't been fixed, but it *is* an error.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #48
"Thomas 'PointedEars' Lahn" <Po*********@we b.de> writes:
IBTD:

"with only minor exceptions ..., ... a full implementation" (M$) and
"a superset ... with mild differences" (Mozilla.org) is much the same
to me.


Yes, but the Mozilla page also says "Like SpiderMonkey, Rhino is
ECMA-262 Edition 3 compliant.". However vague they are in other
places, that line is either too clear to misinterpret. It might be
wrong, but it's not ambiguous :)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #49
Lasse Reichstein Nielsen wrote:
The array literal [0,,2] should not have a property called "1"
according to the ECMAScript standard. [...]
Yes, it should. As of ECMAScript 3, Subsection 11.1.4 (Array Initialiser),
`[0,,2]' is the literal notation of an Array object with the following
structure and content (written as an object literal):

{"0": 0,
"1": undefined, // which is why its value converted to `false'
"2": 2,
// following other Array object specific properties like `length';
// from now on: `...'
}

The productions are:

ArrayLiteral :
[ Elision_opt ]
[ ElementList ]
[ ElementList , Elision_opt ]

ElementList :
Elision_opt AssignmentExpre ssion
ElementList , Elision_opt AssignmentExpre ssion

Elision :
,
Elision ,

"[0,,2]" can be produced by

ArrayLiteral
=> [ ElementList ]
=> [ ElementList , Elision_opt AssignmentExpre ssion ]
=> [ Elision_opt AssignmentExpre ssion , Elision_opt AssignmentExpre ssion ]
=> [ AssignmentExpre ssion , Elision_opt AssignmentExpre ssion ]
=> ...
=> [ 0 , Elision_opt 2 ]
=> [ 0 , , 2 ]

and is therefore evaluated as follows:

...
[ ElementList , Elision_opt AssignmentExpre ssion ]
| 1. Evaluate ElementList.
Evaluate production `ElementList : Elision_opt AssignmentExpre ssion'
| 1. Create a new array as if by the expression new Array().
=> {...} == []
| 2. Evaluate Elision; if not present, use the numeric value zero.
=> 0
| 3. Evaluate AssignmentExpre ssion.
=> 0
| 4. Call GetValue(Result (3)).
=> 0
| 5. Call the [[Put]] method of Result(1) with arguments Result(2)
| and Result(4).
=> [].[[Put]](0, 0)
=> {"0": 0, ...} == [0]
| 6. Return Result(1)
=> [0]

| 2. Evaluate Elision; if not present, use the numeric value zero.
Evaluate production `Elision : ,'
| 1. Return the numeric value 1.
=> 1

| 3. Evaluate AssignmentExpre ssion.
=> 2

| 4. Call GetValue(Result (3)).
=> 2

| 5. Call the [[Get]] method of Result(1) with argument "length".
=> [0].[[Get]]("length")
=> 1

| 6. Call the [[Put]] method of Result(1) with arguments
| (Result(2)+Resu lt(5)) and Result(4).
=> [0].[[Put]](1+1, 2)
=> [0].[[Put]](2, 2)

| 8.6.2.2 [[Put]] (P, V)
|
| 1. Call the [[CanPut]] method of O with name P.
=> true
| 2. If Result(1) is false, return.
| 3. If O doesn?t have a property with name P, go to step 6.
| [...]
| 6. Create a property with name P, set its value to V and give
| it empty attributes.
| 7. Return.

Now you assume that step 6.6. results in an object with the following
structure and content:

{"0": 0,
"2": 2,
...
}

However, ECMAScript 3 also states:

| 11.1.4 Array Initialiser
| [...]
| Array elements may be elided at the beginning, middle or end of the
| element list. Whenever a comma in the element list is not preceded
| by an AssignmentExpre ssion (i.e., a comma at the beginning or after
| another comma), the missing array element contributes to the length
| of the Array and increases the index of subsequent elements.
| Elided array elements are not defined.

Since in "[0, , 2]", the second "comma in the element list is not preceded
by an AssignmentExpre ssion", to be exact, is "a comma [...] after another
comma", "the missing array element ..." [continue reading above]. And so:

| 7. Return Result(1)
=> [0, undefined, 2]

The `in' operation returns `true' if/while the second operand has a
property named as the first operand; since that property ("1") exists
here, it returns `true'. (The property's value does not matter, as
you just explained.)
The error in FireFox/Gecko's ECMAScript implementation is that that
it does, it just has the value "undefined" .


It is not an error :)
PointedEars
Jul 23 '05 #50

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

Similar topics

5
6092
by: Justice | last post by:
Currently I'm doing some experimenting with the XMLHTTP object in Javascript. Now, the XMLHttp object is asynchronous (at least in this case), and the following code causes a significant memory loss even though I seem to be allocaitng everything; help would be *vastly* appreciated. What am I doing wrong here? I thought I was doing everything correctly (setting things to null, for example) but none of the memory seems to get replaced. ...
5
1549
by: Shawn Modersohn | last post by:
For the script: <script language="JavaScript"> function pullPage(){ var arrayLength=document.teamSelectionF.teamSelectionS.length; var pageNav = new Array(arrayLength); var gotoNum=document.teamSelectionF.teamSelectionS.options.value; pageNav="http://www.tandtsports.com"; pageNav="http://www.tandtsports.com/Cougars.html";
55
4216
by: drhowarddrfine | last post by:
I'm working on a web site that could use some control using js but am concerned about what problems I may have with potential users having their js turned off. Has anyone had any serious problems with this sort of thing? I know some of these potential users are with big companies and am wondering if anyone had real problems with that.
10
19176
by: Danny | last post by:
Hi all, I am having some odd problems with AJAX on Firefox (1.5). When I use GET as the request method everything works ok, but when I do a POST the remote function doesn't get the parameters I am passing to it. Everything works fine on IE 6. Here's a couple samples of what I am doing: // using GET url = 'http://www.myserver.com/cgi-bin/funct?key1=value1&key2=value2'
2
2099
by: beseecher | last post by:
Hi, In my research in the javascript language I have encountered problems with implementing prototype inheritance while preserving private methods functioning properly. Here is an example: function A(){ var _this = this; this.a = 10;
1
4954
by: Bob | last post by:
Hi, Hope you can help me with this one. I'm at my wits end. I'm trying to create an intelligent edit-box like the excellent "Customer" one at the URL: http://munich.schwarz-interactive.de/autocomplete.aspx
1
3428
by: kevin.a.sweeney | last post by:
I would like to open an application from a hyperlink on a webpage. 1. the webpage is located on my local machine. 2. the application is located on my local machine. 3. the application will run on my local machine. In other words... The WEB is really not involved. What I have so far works with a Netscape Browser but what I really need is for it to work in the IE browser or one that I will create
14
2818
by: julie.siebel | last post by:
I've been wrestling with a really complex page. All the data is drawn down via SQL, the page is built via VBScript, and then controlled through javascript. It's a page for a travel company that shows all the properties, weeks available, pricing, etc. for a particular area of Europe. The data varies widely depending on the region; at times there will be 50 properties, and at other times only a half dozen. The cross referencing of...
1
1867
RMWChaos
by: RMWChaos | last post by:
I grabbed this "Rock Solid addEvent" code from this site, which is based on Mark Wubben's event-cache code. (These links for reference only.) I am having two problems with it, and the webmaster is s...l...o...w to respond. So I thought I would ask about it here. If I knew more about how this code works, I could probably figure out most of the problems myself, but with this one, I am clueless! =D First question: This may be my own...
10
1856
by: jodleren | last post by:
Hi I know, that there are a lot of people having problems with orkut.com, errors like "object expected" and named objects missing. When loading the site can generate some 10 errors, and still just leave a blue page - seems like it heavily rely on JS. Still, me and friends having problems and orkut seems just to ignore it. I am sure, that other poeple have problems, and I really wonder what
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10195
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.