Log in

View Full Version : .js file with script type="text/javascript and firefox



big-dog1965
09-18-2007, 07:56 AM
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>

Twey
09-18-2007, 08:48 AM
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.

boogyman
09-18-2007, 12:21 PM
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



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.

big-dog1965
09-18-2007, 02:17 PM
I believe what he is attempting to use is



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.

boogyman
09-18-2007, 02:20 PM
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

Twey
09-18-2007, 03:06 PM
Those properties are non-standard and not supported by most browsers.

big-dog1965
09-19-2007, 07:19 AM
I got it to work
thanks