I have looked into creating a javascript that will do a PopUp "Exit Poll" when the client backs out or links forward from the domain. It is a moderated script I found through discussions on this forum.
Now it works great in MSIE5.2.2 on MacOS10.1.5, but I'm finding I better also make sure it works in Mozilla if I have any chance of making it work on the PC side. When i try it in Mozilla, I get Javascript console saying "loadpopup() is not defined"
I've found a couple javascripts that work in MSIE but not Mozilla..this is getting irritating to say the least.
For MacOS10.3 owners using Safari, is the browser compatibility with javascript any better? I feel like I need to get away from MSIE5.2.2 altogether now. And no..I'm not buying a PC. Code:
can somebody give me a minimal example of how to read xml file into mozilla AND run some Javascript funcion?
Mozilla can read xml files directly and css files can be included as well, that works for me. But I would like to do some operations with the DOM tree.
My question is Mozilla only, I would apperciate some minimal example (like alert(1)) and especially some URL pointers.
could you kindly help me to solve a compatibility problem that involves Internet Explorer and NN/Mozilla.
I created a html page that contains a form (its name is "Modulo") and some text boxes. After clicking on a button, a popup appears. I tried to modify the text of "Testo" textbox from the popup windows by using the following javascript code:
window.opener.Modulo.Testo.value=window.opener.Mod ulo.Testo.value + " This will be added to Testo textbox!";
The code is correctly run by Internet Explorer and the "Testo" textbox in the calling html page is successfully updated.
When I try to open these pages with Mozilla, the javascript code that should update the textbox is ignored. How can I solve this problem?
The following posts back properlty from an "onclick" in IE, but not in Mozilla 1.7. Can anyone explain to me why not? The style class works the same in both environments.
Everything works fine with Opera and IE, but not with Mozilla 1.7.3 and Firefox 1.0 PR. When I call a function previously defined inside another function I've got "function is not defined". Why?
I have a strange problem... I have a form with a text area that contains an XML document. This document can be modified by the user.
Once the document has been modified, the user pressed the "Submit" button to submit the modification (onclick=modify())... and go to another jsp page.... in my javascript, I have the following code:
function modify() { myRand=parseInt(Math.random()*99999999); // cache buster var docXML=document.forms[0].xml.value; var plist="myRand="+myRand+"&docXML="+escape(docXML); url="modify_xml.jsp?"+plist; document.forms[0].action=url; document.forms[0].submit(); }
With Firefox, the problem does not occur.... but with Explorer, the form is not even submitted!!!!! Is there a workaround for this? The XML document is not even very big.
I have an XML page I'm trying to load with javascript to display on Mozilla Firefox. I can get this to work on Internet Explorer but it would not work on Firefox. I can't figure out what I'm doing wrong. Can someone glance at my short piece of code below and tell me why this wouldn't work on firefox? Code:
We've got a server-side page (status.php) that dynamically generates a GIF image. The displayed image depends on the value of a boolean field in a database. Just calling the page displays the current value of the boolean, calling it with a parameter switch (status.php?switch) flips the database value and generates a new image. We've included headers to prevent caching of the image by the browser.
Whenever our HTML page is displayed in the browser, we just include an image that shows the current status: img src='status.php'/
We want to allow the user to click the image, which then inverts the boolean status in the database: img src='status.php' onclick='this.src=status.php?switch;'/
This works great in Internet Explorer, but both Mozilla and Opera only allow to switch once. My idea of the problem is that those browsers think like this; after one click, the src is already 'status.php?switch', so changing the src again would be redundent in their eyes, so they won't do it.
We found a temporary solution by generating the current time as a parameter in the image URL: img src='status.php' onclick='this.src=status.php?switch+(new Date());'/ However, this is not a very elegant solution.
Does anyone know a proper solution to this? This means, forcing Mozilla and Opera to load an image using JavaScript, even though the URL of the image didn't change?
Firefox has a Javascript Console that has 3 panels besides "All" and "Clear": "Errors", "Warnings", "Message".
Does anyone know a way to log a message in the Message panel with JavaScript? That would really help debugging. I know there's a way involving XPCOM, but that only works with "trusted" scripts, and scripts loaded thru html aren't trusted.
For a application I am writting I need to make some table columns apear and disapear by clicking on a link. I do this by changing the "style" property in the <td> tag.
The HTML is generated by ASP.NET, which automaticly sets the style property of the <td> tag to the right value. and makes links to the right Javascript function call to change a specific property.
had this in browsers areas but people told me I should put it here in Javascript because more people here would probably have seen it before and know why it happens. I have basic Javascript that rotates images. I've noticed any kind of Javascript code that rotates images has this same problem only in Mozilla. When the images rotate in Mozilla in between the rotations, Mozilla browser adds a little colored square that represents a blank image that are able to be seen does anyone know why Mozilla Browser adds that? For example when looking at this page in Mozilla can see it. if you know if this is some Mozilla problem with Javascript and images. Doesn't happen with IE and other browsers shows the images only and nothing else.
I've a BIG Problem With a HUGE JS application , i'm modifying its javaScript code to work on both IE/Mozilla , currently it works fine on IE but not on Mozilla.
My main Point now is events.
Lets try with a little module, consider this function :
And it is attached in this place like :
This works fine in IE , i want to modify it to work on Mozilla.
I have an 'input' that is of type= "image", and name="butt", that I need to enable/disable from time to time.
In IE (6) I used [document.theform..butt.disabled=condition] and it worked fine. However, in a Mozilla (latest vers, no number avail) it doesn't see this as an object. As a workaround I declared a global var 'theButton' and used 'onLoad="theButton=this;"' within that 'input' to set the value, and this works fine in both Moz & IE.
Having to use a global var is not a problem, but I would like to know why the original attempt didn't work in both browsers? The 'form' that 'butt' is a member of contains 1 select, 3 type="text" inputs, and finaly the type="image" input.
Perhaps Moz doesn't add an 'input' of type="image" to the collection if the types are mixed?
I have this script and I want to adapt it to the DOM of most / all well known browsers like mozilla and netscape.. at the moment it only works in ie4+ en ns6. can anybody give me some hints? This is used for making a tree <li><ul>
var ns6 = document.getElementById && !document.all; var ie4 = document.all && navigator.userAgent.indexOf("Opera") == -1;
function checkcontained(e) { var iscontained = 0; cur = ns6 ? e.target : event.srcElement; if (cur.id == "foldheader") { iscontained = 1; } else { while (ns6 && cur.parentNode || (ie4 && cur.parentElement)) { if (cur.id == "foldheader" || cur.id == "foldinglist") { iscontained = (cur.id == "foldheader") ? 1 : 0; break; } cur = ns6 ? cur.parentNode : cur.parentElement; } } if (iscontained) { var foldercontent = ns6 ? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]; if (foldercontent.style.display == "none") { foldercontent.style.display = ""; cur.style.listStyleImage = "url(images/open.gif)"; } else { foldercontent.style.display = "none"; cur.style.listStyleImage = "url(images/fold.gif)"; } } }
if (ie4 || ns6) { document.onclick = checkcontained; }
I have some functions in a script in which I'm manipulating the innerText and background colors of certain rows in a table. The lines below work OK in IE but when I try them in Mozilla, I get an error that says: "document.getElementById('TableX').rows is not a function".
I am trying to disable the F5 key in Mozilla. I have the next code in javascript that it is working in Internet Explorer but it is not working in Mozilla. how can I disable the F5 key in Mozilla?
It's worth nothing that the incoming variable is a product of XSLT transformation, so I think it's technically an XML DOM element (although I'm not too sure on the difference between the XML DOM and the HTML DOM).
On the incoming variable, I do getElementsByTagName("tr") and -("td") to get NodeLists of the rows and columns respectively. To insert them into the table, I create new tr and td elements, then copy the value over, like this:
//stuff to get a column trs = getElementsByTagName("tr"); tds = trs[i].getElementsByTagName("td"); thiscol = tds[j];
//stuff to copy the column value new_tr = document.createElement("tr"); new_td = document.createElement("td"); new_td.innerHTML = thiscol.xml
The .xml part is a Microsoft creation, so the only works in Internet Explorer. In anything else the column value is rendered as 'undefined'.
I'm trying to make things work in Mozilla too, but an Element node (thiscol.nodeType gives me Ƈ') doesn't have nodeValue implemented. InnerHTML and OuterHTML are not implemented either.
How on earth are you supposed to extract a value from an XML node if nodeValue is not defined? Am I going about things in the wrong way?
I am facing problem with updating form element using javascript in MOZILLA Details are as follows.
I have a div containing form element. on submit , i am submitting the form using javascript-ajax and processing the form. then after successfully processing i am replacing innerHTML of div with same form. I am able to see same form on page after ajax update but when i refill the form and submit it again..javascript is not able to find the form element in HTML DOM.
This problem comes with mozilla-firefox but it works fine with IE 6 ...
I embedded a javascript in HTML and tried to open the file using mozilla 1.4 it gave me the following exception in the script on clicking the Submit/Next button. IE was able to execute the script
Function defination function evaluate(form)
Line making the call : <INPUT onclick="if (validate(this.form)) evaluate(this.form);" type=button value=Submit/Next name=B1>
I've a personal application I would like to script, that would bring up a particular web page (which happens to have a Flash application on it), then every 15 minutes or so generate the equivalent of clicking on a button (causing the application to retrieve and display the latest info).
Anyone know of any articles or howtos on the web for writing such an application? Code:
I've made these functions quite some time ago, and quite possibly this code is quite ugly, but it works. Obviously this would be only useful if you are a masochistic xhtml-coder and you want an easy way (kind of contradictory with a masochist) to dynamically add or remove markup/text.
I am trying to disable the F5 key in Mozilla. I have the next code in javascript that it is working in Internet Explorer but it is not working in Mozilla. how can I disable the F5 key in Mozilla?
Code:
function checkKeyCode(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);