www.webdeveloper.com
Results 1 to 8 of 8

Thread: <Script language=Javascript1.2"

  1. #1
    Join Date
    Feb 2004
    Posts
    1

    Question <Script language=Javascript1.2"

    Hi there,
    Trying to add <Script language=Javascript1.2> to a web page,
    and am getting an error message 'The values permitted for this attribute do not include 'Javascript1.2".
    'Javascript' works though.
    Can anyone help?

  2. #2
    Join Date
    Mar 2003
    Location
    The Lone Star State
    Posts
    1,126
    this is the correct way to do it
    <script type="text/javascript"></script>

  3. #3
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602
    Originally posted by soccer362001
    this is the correct way to do it
    <script type="text/javascript"></script>
    <script type="text/javascript1.2"></script>

  4. #4
    Join Date
    Jul 2003
    Location
    Boston Area, Massachusetts
    Posts
    3,489
    Originally posted by 96turnerri
    <script type="text/javascript1.2"></script>
    I've made that mistake before, however, it was merely a typo; content-types do not have version numbers and thus it should only be text/javascript.

  5. #5
    Join Date
    Nov 2002
    Posts
    4,473
    Code:
    <script language="JavaScript1.2">
    is valid for Netscape browsers and it indicates that the browser should use JS 1.2 rules as opposed to the default for the particular browser version. IE will not care what the script tag says because it does not support multiple JS versions.

    The W3C recommendations for the script tag say that the "language=" part is deprecated because the identifiers are not standard. Actually they are vendor specific, but I guess that if the W3C doesn't have a standard for it, then it isn't standard. So they want to see "type=" and then you have to go fishing for a MIME type (hey, that's real standard, isn't it?) and (oh, yeah BTW) it is still going to be vendor specific. If you make a script tag
    Code:
    <script type="text/vbscript">
    then NS 4 will cough up a fur ball because it will assume that it is Javascript anyway, but Mozilla and NS 6+ will ignore the tag.

    So if you don't care about older browsers, depricate away, friends. Otherwise, use both.
    Code:
    <script language="JavaScript1.2" type="text/javascript">
    ...
    <script language="JavaScript1.2" type="text/ECMAscript">
    ...
    <script language="JavaScript1.2" type="Jscript">
    Yeah, real standard...

  6. #6
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602
    ok thanks for the tip fredmv

  7. #7
    Join Date
    Nov 2002
    Location
    Nashua, NH
    Posts
    3,195
    Originally posted by gil davis
    <snip />
    So if you don't care about older browsers, depricate away, friends. <snip />
    Since
    1. Your page should be functional without javascript.
    2. There is not ROI trying to script for old browsers
    there is no need to use deprecated attributes.
    There is one line that deals with older browsers which should be the the first one in your initialization function:
    Code:
    if(!document.getElementById) return;

  8. #8
    Join Date
    Jan 2014
    Posts
    2
    Hello,

    The below script not working on declaring doctype

    <!DOCTYPE HTML>---------------when i make it only <html> this is working
    <head>
    <meta charset="utf-8">
    <title>scroll up and down</title>

    </head>
    <body>
    <div id="point1" STYLE="position:absolute;visibility:visible;">
    <!--Please delete this table and insert into your html elements-->
    Here Image and text will come
    <!--End of the customizable area, please do not delete div the tag -->
    </div>


    <script type="text/javascript">
    var XX=20; // X position of the scrolling objects
    var xstep=1;
    var delay_time=60;

    //Begin of the unchangable area, please do not modify this area
    var YY=0;
    var ch=0;
    var oh=0;
    var yon=0;

    var ns4=document.layers?1:0
    var ie=document.all?1:0
    var ns6=document.getElementById&&!document.all?1:0

    if(ie){
    YY=document.body.clientHeight;
    point1.style.top=YY;
    }
    else if (ns4){
    YY=window.innerHeight;
    document.point1.pageY=YY;
    document.point1.visibility="hidden";
    }
    else if (ns6){
    YY=window.innerHeight
    document.getElementById('point1').style.top=YY
    }


    function reloc1()
    {

    if(yon==0){YY=YY-xstep;}
    else{YY=YY+xstep;}
    if (ie){
    ch=document.body.clientHeight;
    oh=point1.offsetHeight;
    }
    else if (ns4){
    ch=window.innerHeight;
    oh=document.point1.clip.height;
    }
    else if (ns6){
    ch=window.innerHeight
    oh=document.getElementById("point1").offsetHeight
    }

    if(YY<0){yon=1;YY=0;}
    if(YY>=(ch-oh)){yon=0;YY=(ch-oh);}
    if(ie){
    point1.style.left=XX;
    point1.style.top=YY+document.body.scrollTop;
    }
    else if (ns4){
    document.point1.pageX=XX;
    document.point1.pageY=YY+window.pageYOffset;
    }
    else if (ns6){
    document.getElementById("point1").style.left=XX
    document.getElementById("point1").style.top=YY+window.pageYOffset
    }

    }

    function onad()
    {
    if(ns4)
    document.point1.visibility="visible";
    loopfunc();
    }
    function loopfunc()
    {
    reloc1();
    setTimeout('loopfunc()',delay_time);
    }

    if (ie||ns4||ns6)
    window.onload=onad

    </script>
    </body>
    </html>



    ned your help to run this script with declaring doctype

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles