473,406 Members | 2,745 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,406 software developers and data experts.

javascript corrupted?

I tried this in iexplorer, mozilla, opera.
var in = 1;
switch( in ){
case 1:
in = "-1-";
break;

case 2:
in = 2;
break;

default:
document.writeln(' <FONT COLOR="black">dddddddd </FONT>');
}

alert(in);
document.writeln('<FONT COLOR="black">ffffffffffffffffff</FONT> ');
Is it not supposed to work?

--
Jean Pierre Daviau
--
Easyphp1.8
Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
http://www.jeanpierredaviau.com
Feb 12 '06 #1
7 4499
Jean Pierre Daviau wrote:
I tried this in iexplorer, mozilla, opera.
var in = 1;
'in' is a reserved word in JavaScript, do not use it for variable names.
This line causes an error message in the Firefox Javascript console of
'missing variable name'.

Change the variable name to something else and maybe it will 'work'.
[...]
Is it not supposed to work?


'Work'? What result did you expect? What did you get? Error messages?
--
Rob
Feb 12 '06 #2
Nothing.
A blank page with ie debugger and Frontpage debugger.

So it was hard to find....

Well, I should have remember. But I did not play with JavaScript for 4
years at least...

Thank you
"RobG" <rg***@iinet.net.au> a écrit dans le message de news:
9m*****************@news.optus.net.au...
Jean Pierre Daviau wrote:
I tried this in iexplorer, mozilla, opera.
var in = 1;


'in' is a reserved word in JavaScript, do not use it for variable names.
This line causes an error message in the Firefox Javascript console of
'missing variable name'.

Change the variable name to something else and maybe it will 'work'.
[...]
Is it not supposed to work?


'Work'? What result did you expect? What did you get? Error messages?
--
Rob

Feb 12 '06 #3
Nothing either. I think my javascript is corrupted.

<SCRIPT type="javascript" language="JavaScript">
var entrant = 1;

switch( entrant ){
case 1:
entrant = "-1-";
break;

case 2:
entrant = 2;
break;

default:
document.writeln(' <FONT COLOR="black">dddddddd </FONT>');
}

alert(entrant);
document.writeln('<FONT COLOR="black">ffffffffffffffffff</FONT> ');
</SCRIPT>
</head>
<body>
<SCRIPT type="javascript" language="JavaScript">
<!--
alert()
document.writeln('<FONT COLOR="black">ffffffffffffffffff</FONT> ');
//-->
</SCRIPT>
Feb 12 '06 #4
Jean Pierre Daviau wrote:
Nothing either. I think my javascript is corrupted.

<SCRIPT type="javascript" language="JavaScript">
Unknown script type and language is deprecated, use:

<script type="text/javascript">
var entrant = 1;

switch( entrant ){
case 1:
entrant = "-1-";
break;

case 2:
entrant = 2;
break;

default:
document.writeln(' <FONT COLOR="black">dddddddd </FONT>');
You should update your HTML too, the font element has been deprecated
for quite a while. An HTML 4 compliant alternative is:

document.writeln(' <span style="color: black;">dddddddd </span>');

}

alert(entrant);
document.writeln('<FONT COLOR="black">ffffffffffffffffff</FONT> ');
</SCRIPT>
</head>
<body>
<SCRIPT type="javascript" language="JavaScript">
As above, error with type & remove language attribute.
<!--
No need for this, just remove it.
alert()
document.writeln('<FONT COLOR="black">ffffffffffffffffff</FONT> ');
//-->
And remove this one too.

</SCRIPT>



--
Rob
Feb 13 '06 #5
Jean Pierre Daviau wrote:
I tried this in iexplorer, mozilla, opera.
var in = 1;
switch( in ){
case 1:
in = "-1-";
break;

case 2:
in = 2;
break;

default:
document.writeln(' <FONT COLOR="black">dddddddd </FONT>');
}

alert(in);
document.writeln('<FONT COLOR="black">ffffffffffffffffff</FONT> ');
Is it not supposed to work?


No. I ran it through JSLint, and it reported:

Error:

Problem at line 1 character 5: Expected an identifier and instead saw 'in'.

var in = 1;

'in' is a reserved word.

http://www.JSLint.com/
Feb 13 '06 #6
Try it here. This page does not work for me:
http://www.jeanpierredaviau.com/delme.html

It does not work for me. But I do can go on websites with javascripted pages
? ?????????????

It seems only some core javascript dont work like functions or alert().
Feb 13 '06 #7
javascript:var entrant = 1;switch( entrant ){case 1:entrant =
"-1-";break;case 2:entrant = 2;break;default:}alert(entrant);

the previous works in the addres bar.
Feb 13 '06 #8

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

Similar topics

3
by: r.e.s. | last post by:
No matter which site I download it from, NumTut.tgz appears to be corrupted. Anyone else having this problem? Thanks. -- r.e.s.
1
by: WKC | last post by:
Recently, one of our database's mdf and ldf was corrupted. We were able to bring back the database with the capability of importing and querying the data. However, the data is not the full list. ...
1
by: bugman | last post by:
The problem started with Firefox. Got to www.foxnews.com and click on any of the scrolling headlines in the right hand box. Firefox would crash. Now Opera and IE do also. If I disable...
3
by: Bob Hynes | last post by:
Hi All, Does anyone know of a place where a corrupted mdb(front-end) can be sent and have that place be able to tell me what got corrupted within the db? Here's the issue; All pc's are WindowsNT...
28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
1
by: hrishikesh | last post by:
hi all can you tell me how to call javascript function in .aspx page i want to call it on onclick of button this codebehind code giving me some other problem like The viewstate is invalid for...
2
by: Vinod I | last post by:
Hi Team, When I tryed following code, I am getting the Runtime Error as "The View State is invalid for this page and might be corrupted." Exception Details: System.Web.HttpException: The View...
28
by: Noone Here | last post by:
AIUI, it was not all that long ago when the threat to personal users, was attachments that when executed compromised machines with keyloggers, trojans, etc. Now it seems that the big problem is...
9
by: advance scout | last post by:
HELP! My database is suddenly corrupted. My computer was acting funny (very sluggish) and was shut down. Access had been already been closed down but computer was acting very slow , so perhaps it...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.