Code Won't Work For Firefox / Solution For This?
Dec 13, 2011I want to focus on my error field but this won't work in firefox code...
View 1 RepliesI want to focus on my error field but this won't work in firefox code...
View 1 RepliesI was trying to get the code below to work in Firefox as I can see it was aimed at old IE and Nestscape. I does work on IE7 but not Firefox or Safari or Chrome.What I was trying to achieve was playing a sound on mouseOver which would stop on mouseOut. That's all. I tried other things before I bumped into the code bellow. This one was very much what I needed but I really need to get it work in browsers other than IE and Netscape.Bellow is the original code:
Code:
<script LANGUAGE="JavaScript"><!--
var aySound = new Array();
// Below: source for sound files to be preloaded[code]....
re-engineer the above but have a different solution to playing a sound when you hover over a button (solution that works on the major browsers out there),
This code works on ie7, but it does not work on firefox. it just shows a alert when focus occur on an element. you can just click something on the page and you will see alert at ie7.
View 1 Replies View RelatedI'm developing a relatively simple html based site for a gallery. Small images of paintings link to a popup window with a larger image of the painting. The problem is that the javascript code doesn't seem to work in Chrome or the new version of Firefox (where it only opens a new blank tab), though it works perfectly in Safari. This is my code (for vertical images):
var viewerWin=0;
function windowPopVer(URLStr)
{
if(viewerWin)
{
What am I doing wrong? We've changed the settings in Chrome and Firefox so that it enables javascript and all that. Why won't this work?
I recently made a simple tool that opens a website in an iFrame and tells the user how long the page took to load. I made it out of a premade stopwatch
When i run the test in most browsers (Chrome, Firefox 3.6 and older, IE) it works fine with the output textbox going from "Please run the test" to "Test Running" to [TIME TAKEN FOR PAGE TO LOAD] but in firefox 3.7 (Minefield) it goes from "Please run the test" to "0" every time and the page in the iFrame doesn't load.
I've read that Firefox 3.7 has a new Javascript Engine
The test is at [URL] and the problem code is on THIS PAGE (Use View Source in your browser)
I created a page with a thumbnail viewer. Click on a thumbnail and a larger version appears on the same page, NOT a pop up or Lightbox. It previews and validates fine. Even runs in IE. But not in FF(V. 3.6.18). Ideas? Code below with JS highlighted.
[Code]...
This works fine in IE only. code...
View 8 Replies View RelatedI have a javascript running on my site at that disables right clicking (viewing source, saving pictures, etc.) that works beautifully in IE...but not in Firefox. Does anyone know of a solution?
View 6 Replies View RelatedSimple random pic script that I found on the some other forum (I forget what it was) code...
code anchors to HTML markup [CODE]
it is working perfectly for Safari and Chrome. Nothing is showing for FF.
I am trying to use the slideshow javascript found at this site
but i can't get the following line of code to stick in my webpage code...
i follow the directions exactly, but that line above keeps getting 'spit' out of my page altogether...in fact, my webpage does not have any body tags per se, it keeps spitting them out when i try to put them in. the webpage functions just fine--no problems--but i can't get this slideshow script to work b/c i can't get the 'onload' instruction to stay--that body tag keeps getting stripped from my html page...
any ideas as to how to make this script work for me?
I have an appendchild script that adds an <input> element when a current one is clicked. It then gets posted by a PHP script. Everything works perfectly in IE, but in Firefox, nothing gets posted.code...
View 12 Replies View RelatedI am a novice, almost to an intermediate-level JavaScript guy, so much of this is new to me. I appreciate your patience reading this.
I have a routine that creates some HTML on the fly (updateFilters() function) and after the HTML is created, I attempt to access some fields (elements) on the form itself.
I works fine if I place an alert() statement after the HTML is created, but when I remove, the code errors out.
I have tried the setTimeout() statement, but I cannot grab the element --- undefined or null is returned. It seems that the form is the only element I can get a handle on --- everything else is undefined or null...
Here is the code:
function editQuery() {
var f;
var x;
var myForm = document.forms[0];
// Get the row filters that were used in the last query..
for (f = 1; f < 16; f++) {
var filter = eval("myForm.FilterList_" + f);
if (filter.selectedIndex > 0) {
var methodElement = element("FilterMethod_" + f);
var methodIndex = methodElement.selectedIndex;
var savedFilterMethodValue = methodElement.options[methodIndex].text;
var choicesElement = element("FilterChoices_" + f);
var choicesIndex = choicesElement.selectedIndex;
if (isNaN(choicesIndex)) {
var savedFitlerValues = choicesElement.value;
}
else {
var savedFitlerValues = choicesElement.options[choicesIndex].text;
}
updateFilters(filter); // update the filters
// take the saved methods and values and then update the selections
// Alert here makes the code work..
// alert("Try this");
// Wait for HTML..
setTimeout("completeEdit()", 1000);
function completeEdit() {
// Since the object was updated, get the object again..
var methodElement = element("FilterMethod_" + f);
for (x = 0; x < methodElement.options.length; x++) {
if (methodElement.options[x].text == savedFilterMethodValue) {
methodElement.options[x].selected = true;
break;
}
else {
methodElement.options[x].selected = false;
}
}
// Since the object was updated, get the object again..
var choicesElement = element("FilterChoices_" + f);
for (x = 0; x < choicesElement.options.length; x++) {
if (choicesElement.options[x].text == savedFitlerValues) {
choicesElement.options[x].selected = true;
break;
}
else {
choicesElement.options[x].selected = false;
}
}
// Only display next row if f = 2..
// If only one row was used, no reason display the next row..
if (f == 2) {
displayNextFilter(f - 1); // display it
}
}
clearTimeout(timeOut);
}
}
}
Do I have to pass the object (the form, the elements) to the completeEdit() function in the setTimeout() statement?
I am trying to hide this code:
HTML Code:
using this code
HTML Code:
This works fine when I place this code under the html in the main source, but if I try to add this Jquery code to an external js sheet it doesnt seem to work?
Currently my js sheet is called in the header, when I move this link to the footer of my page the code works again, so Im guessing this has something to do with where the jquery code is placed in relation to the code Im trying to hide?
How I can keep my js in the header but still make the content disappear on click?
I have created a very simple JavaScript code to display larger images of a thumbnail image on the main section of a website. It works fine in FF3 however in IE 7 is giving me an error code of Invalid argument on line 6 character 1. The funny thing is I have used this exact code in another site and it worked fine with IE 7.
View 2 Replies View RelatedI have the following code:
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all && !document.getElementById) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (!document.all && document.getElementById) ? true : false;
function show(sw,obj) {
// show/hide the divisions
if (sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'visible'
if (!sw && (ie4 || ie5) ) document.all[obj].style.visibility = 'hidden'
if (sw && ns4) document.layers[obj].visibility = 'visible'
if (!sw && ns4) document.layers[obj].visibility = 'hidden'
}
function showme(myarea,x){
//alert(myarea);
if(myarea==1){
//alert("area is yerushalayim");
show(true,x)
}}
for some reason it's not working at all on firefox -- (the hidden div never gets visible) -- anyone know why and how to fix?
I want to get the colour in HEX format using "thing.style.backgroundColor". Like "#FFFFFF" or whatever. IE gives this but FF gives it as "rgb(0,0,0)" format.
Is there a simple function/method of getting it as hex? (or a conversion function)
This code works inside my coffee cup test browser but when i test in other browsers it doesnt work at all. none of the features work, drag and drop, highlight text on focus, and cursor change on mouse over.heres a simple code i put together.
<html> <head> <title>sample</title>
<script type="text/javascript">
function handleMouseMove(oEvent) {
[code]....
i have a item switcher i have made in php and java script but for some reason it works in google chrome but not in firefox. The switcher lets the user pick 1 item and make it there active item so they can do things with it.
[Code]...
I've inherited a page that enters data into a database, some of the fields are calculated and one uses today's date. In Firefox it all works fine but in IE it wont load the full page.
View 2 Replies View Related<HTML>
<HEAD>
<TITLE> MEA </TITLE>
[code].....
I have the following code that I modified from an online article that works great in internet explorer but not in Mozilla Firefox.
Code:
<script language="JavaScript">
var NS4 = (document.layers);
[code].....
I have the following algorithm
1. Show message DIV
2. Long Loop Function
3. Hide message DIV
Opera shows DIV well. Firefox and IE don't show the DIV.
If to rewrite the algorithm like this Firefox and IE will show DIV
1. setTimeout(Long Loop Function,500)
2. Show message DIV
I also tried to debug the first algorithm in Firebug, and in step by
step mode I see that Firefox shows the DIVs.
Is it standart behaviour? What prevents browsers from showing the DIV?
Code... I have this simple script in the head of my html file. It works just fine in IE but not firefox.
View 5 Replies View Relatedi have a website at [URL] and i want to allow access to only internet explorer and firefox users. I've heard Javascript is good for this. The reason i want to do this is because in Google Chrome my site messes up on several pages.
View 3 Replies View RelatedI am trying to use onclick to add text to a textarea, the function I am using is:
function addtxt(input,add) {
var obj=document.getElementById(input)
var txt=document.createTextNode(add)
obj.appendChild(txt)
}
and the line that I use to call the function - through php- is:
<a onclick="addtxt('post','$code');">
<img src="smiles/$smile" alt="$smilename" border="0" style="cursor: pointer;"></a>
it seems to work in IE but not in firefox, why is that?
I tried this in my script:
Code:
newWindow.document.bgColor="#CC9900";
It does not work in FF, is there an alternative for adding color directly to the document object?