Results 1 to 7 of 7

Thread: .js file with script type="text/javascript and firefox

  1. #1
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default .js file with script type="text/javascript and firefox

    I have a .js file that a page refers to in IE seems to work but fire fox I get a couple of errors can someone help me with this.
    Error: missing ; before statement for this
    <style type="text/css">
    html, body{
    scrollbarArrowColor='black';
    scrollbarBaseColor='#EBF5FF';
    scrollbarDarkShadowColor='#3F3F3F';
    scrollbarTrackColor='#F3F3F3';
    scrollbarFaceColor='#EBF5FF';
    scrollbarShadowColor='#EBF5FF';
    scrollbarHighlightColor='#EBF5FF';
    scrollbar3dLightColor='#78AAFF';
    }
    </style>

    And Error: disableSelection is not defined for this. I have this in my page that links to the js file disableSelection(document.body)

    <script type="text/javascript">
    function disableSelection(target){
    if (typeof target.onselectstart!="undefined") //IE route
    target.onselectstart=function(){return false}
    else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
    target.style.MozUserSelect="none"
    else //All other route (ie: Opera)
    target.onmousedown=function(){return false}
    target.style.cursor = "default"
    }

    //Sample usages
    //disableSelection(document.body) //Disable text selection on entire body
    </script>

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Error: missing ; before statement for this
    <style type="text/css">
    html, body{
    scrollbarArrowColor='black';
    scrollbarBaseColor='#EBF5FF';
    scrollbarDarkShadowColor='#3F3F3F';
    scrollbarTrackColor='#F3F3F3';
    scrollbarFaceColor='#EBF5FF';
    scrollbarShadowColor='#EBF5FF';
    scrollbarHighlightColor='#EBF5FF';
    scrollbar3dLightColor='#78AAFF';
    }
    </style>
    This isn't Javascript. What's it doing in a .js file? Actually, it's not CSS either. What is this?
    <script type="text/javascript">
    function disableSelection(target){
    if (typeof target.onselectstart!="undefined") //IE route
    target.onselectstart=function(){return false}
    else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
    target.style.MozUserSelect="none"
    else //All other route (ie: Opera)
    target.onmousedown=function(){return false}
    target.style.cursor = "default"
    }

    //Sample usages
    //disableSelection(document.body) //Disable text selection on entire body
    </script>
    No tags in a JS file.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by Twey View Post
    This isn't Javascript. What's it doing in a .js file? Actually, it's not CSS either. What is this?No tags in a JS file.
    I believe what he is attempting to use is

    Code:
    scrollbar-face-color: #fff;
    scrollbar-highlight-color: #fff;
    scrollbar-3dlight-color: #fff;
    scrollbar-darkshadow-color: #fff;
    scrollbar-shadow-color: #fff;
    scrollbar-arrow-color: #fff;
    scrollbar-track-color: #fff;
    even though it looks like what he was doing was attempting to use the Javascript equivalents, even though those weren't correctly implemented either.

  4. #4
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by boogyman View Post
    I believe what he is attempting to use is

    Code:
    scrollbar-face-color: #fff;
    scrollbar-highlight-color: #fff;
    scrollbar-3dlight-color: #fff;
    scrollbar-darkshadow-color: #fff;
    scrollbar-shadow-color: #fff;
    scrollbar-arrow-color: #fff;
    scrollbar-track-color: #fff;
    even though it looks like what he was doing was attempting to use the Javascript equivalents, even though those weren't correctly implemented either.
    In firefox now this is the only error I get. Im just showing one but theres an error for each scrollbar line.
    Warning: Unknown property 'scrollbar-face-color'. Declaration dropped.

  5. #5
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by big-dog1965 View Post
    In firefox now this is the only error I get. Im just showing one but theres an error for each scrollbar line.
    Warning: Unknown property 'scrollbar-face-color'. Declaration dropped.
    firefox doesnt allow you to change the properties of the scrollbar

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Those properties are non-standard and not supported by most browsers.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I got it to work
    thanks

Bookmarks

Posting Permissions

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