Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript versions

Status
Not open for further replies.

GIGN

Programmer
Oct 6, 2000
1,082
NZ
Whenever I try to use say JavaScript 1.2 or something I get an error, even if no other versions exist on that page.

This is starting to limit me because I am lacking some functionality, please help:


<script language=&quot;JavaScript 1.2&quot;>

</script>


This is correct in syntax is it not?
Thanks in advance,
Ben
 
The standard seems to be not to bother with the 1.2, and just use
Code:
<script language=&quot;javascript&quot;>

</script>
Greg.
 
Yes but I find JavaScript 1.2 syntax does not work! Like when opening a new window, screenX screenY don't work.
Why is this?

 
In what context are you using screenX & screenY to open a window? I may be wrong, but to the best of my knowledge, screenX and screenY are properties of the client object, and they return the mouse position.

Greg.
 
Or on second thoughts, I could be talking gibberish! X-)

Greg.
 
Well who knows, none of it makes any sense to me, may javascript book says that should work, but it doesn't seem to, there must be something I am overlooking, but my browser will not read any script tags marked anything but

JavaScript.

 
Code:
<script LANGUAGE=&quot;JavaScript&quot;> <!--
version=10; //--> </script>
<script LANGUAGE=&quot;JavaScript1.1&quot;> <!--
version=11; // --> </script>
<script LANGUAGE=&quot;JavaScript1.2&quot;> <!--
version=12; // --> </script>

<script LANGUAGE=&quot;JavaScript&quot;> <!--
if (version>=12) {do_version_12_stuff();}
if (version=11) {do_version_11_stuff();}
// et cetera
//--> </script>
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
I don't quite understand your point? That code wil just set version to 1.2 will it not? Or is there something I am missing regarding what a version implies?
Supposedly if you leave out the language attribute altogether, the browser interprets the following script as the newest version. I try this, nothing, I must be on the wrong track.

My problem is I cannot get any response from features implemented in version 1.2, no matter how hard I try!

As an example supose I want to opena new window in aparticulr place with this:

open('','','screenX=100,screenY=200')

Nothing happens, indicationg to me it does not understand.
Do you reckon you could help out here, it is REALLY bugging me!

Thanks, Ben.
 
Is this just on your own personal machine? It's probably your settings. Make sure JavaScript is enabled.

Otherwise, the script I gave above will set &quot;version&quot; to be the version on the client machine. Using that info, you can create different functions for different JavaScript versions.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Why is there some way to enable one version and not another, surely if one works, the others will too?

Please excuse my ignorance!
Ben.
 
Why? Is there some way to enable one version and not another, surely if one works, the others will too?

Please excuse my ignorance!
Ben.
 
All that was going wrong was, contrary to what this book says, the correct name of the attributes is top and left, not pixelTop or pixelLeft.

This I have encountered before when sliding elements across the screen.

All I ask is consistency! Do you know what is going on? Why is top used one minute, then pixelTop the next? And why aren't they interchangeable...

Is this all Netscrap's fault? (kudos to iza for that gem!)
 
No, not all JavaScript versions work on all browsers. It's a progressively developing standard. Older browsers have older versions of JavaScript. Netscape and Microsoft have different syntax.

Try and to get the exact syntax on the latest versions of JavaScript and JScript.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Bangers wrote ...
As an example supose I want to opena new window in aparticulr place with this:

open('','','screenX=100,screenY=200')

Nothing happens, indicationg to me it does not understand.
Do you reckon you could help out here, it is REALLY bugging me!


I had the same problem yesterday, and this solved it.

open('','','left=100,top=200')


Greg.
 
Yeah, weird huh! I have had this happen with other things, like sliding elements, sometimes you must use pixelTop etc..

consistency would be nice wouldn't it!

Ben &quot;Lyin, cheatin, hu-urtin, that's a-all you seem to do-oo-oo&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top