This Works In IE But Not In Mozilla

Jul 23, 2005

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".

thisRow = document.getElementById('TableX').rows(1);
thisRow.style.background = 'white'

Can anyone give me a clue as to how to fix this so that it will work
in both browsers?

View 2 Replies


ADVERTISEMENT

Works In IE,NS4, NOT MOZILLA?

Jul 7, 2003

This works in IE and NS4 but in Mozilla (Firebird) it displays part of the javascript as page content instead of scripting. It's a very old 'mouseover generator' that writes javascript that had so many requests when I removed it I had to put it back in.

View 4 Replies View Related

Function Works On IE But Not On Mozilla FF

Nov 28, 2005

Following function works for IE, but not for Mozilla FF. I am truncating the string to size =20. Also I am using custom attribute att as I have too many tags inside a <td>.

function trunc_dest()
{
var x = document.getElementById('chtbl');

var t = x.getElementsByTagName('tr');
for (var i = 0; i < t.length; i++)
{
var d = t[i].getElementsByTagName('td');
for (var j = 0; j < d.length; j++)
{
if (d[j].att == 'dest')
{
// var e = d[j].innerHTML;
var w_str = unescape(d[j].innerHTML).split('<');
// alert(w_str[0]);
if (parseInt(w_str[0].length) > 20)
{
d[j].innerHTML = w_str[0].substring(0,19)+"...*";
} } } }}

View 2 Replies View Related

Accessing Body Of An Iframe, Works In Ie Not In Mozilla.

Jul 23, 2005

I am relatively new to javascript and am working on a script where I
want to utilizes a couple of iframes and format text in them. I have
run into a problem with getting the following code to work in mozilla.
It seems to work in ie.

Eventually I will be replacing the H1 node with a table until I can get
the H1 node to show up in mozilla there is not much point.

I have tested using both a javascript created iframe and one built in
the html file. In both cases the iframes have an id of something_ifr...

View 3 Replies View Related

Using To Get XML Data, Works In Mozilla But NOT Internet Explorer?

May 17, 2011

I am making a visual database for our company to give to our sister company in another state so they can have name, phone, email, and a picture. All of this information is in XML outside of the HTML document. I have provided the HTML and XML below. It works perfectly with Mozilla, but all Internet Explorer displays nothing from the XML. Please tell me what I'm doing wrong because I am completely stumped

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<departments xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

[code]....

View 1 Replies View Related

How Can I Delete A Cookie In Internet Explorer - It Works In Mozilla !

Feb 3, 2006

I have the following code which deletes, i.e. sets the cookie in the past, a cookie.

var cookie_name = 'memberCookie'
var cookie_date = new Date(); // Current Date & Time
cookie_date.setDate (cookie_date.getDate() - 5);
var cookie = cookie_name + "=; expires=" + cookie_date.toGMTString() + "; path=/";
parent.menu.document.cookie = cookie;
parent.menu.location.reload(1)
parent.menu.document.cookie - this is just the path to the cookie which resides in a frame called menu.

This code works in Mozilla, as it stores the cookie by name i.e. memberCookie, however in Internet Explorer the cookie file is named ti8@localhost[1] which is just my username and server name from uni. Is this the reason it cannot delete the cookie? Or despite the file being called ti8@localhost[1] the cookie is really named memberCookie?

Can anyone please provide any advice for me. Would I need two seperate statements, one which deletes the cookie in Mozilla and one for IE?

View 1 Replies View Related

When The Images Rotate In Mozilla In Between The Rotations, Mozilla Browser Adds A Little Colored Square That Represents A Blank Image?

Jul 16, 2009

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.

View 2 Replies View Related

Porting App To Mozilla - Work On Both IE/Mozilla ?

Nov 30, 2010

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.

View 2 Replies View Related

JavaScript Popup On Window Close: Works Great On IE, Works Terribly On FF

Dec 13, 2006

I'm just restating my "site abandonment" post but with a clearer title as I realized it probably only made sense to me and me alone.

I have window that pops up with our commerce system. I have it set to pop up a window via JavaScript if the visitor quits early in the process (abandons the commerce system before completing all of the steps. The new popup is just a customer survey ("why are you leaving, is there something else we can help you with" etc. etc.).

Here's the problem, it works fine in IE, but in Firefox, anytime the page in the original commerce window is changed, refreshed or advanced to a new page, the survey popup window is called rather than just on window close.

Again, here's the two JavaScript routines that handle clicks on the graphical close button and on the window 'X' close button. Code:

View 9 Replies View Related

Mozilla And DOM

Oct 29, 2006

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?

View 4 Replies View Related

Ns4,6,ie5,6 And Mozilla

Jul 20, 2005

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;
}

View 6 Replies View Related

XmlHttp With Mozilla?

Jul 23, 2005

anyone have a code example of using xmlhttp with mozilla, if i use the
following code, the function is never called, but it does work in IE.

xmlhttp.
{

if (xmlhttp.readyState == 4)
{
var response = xmlhttp.responseText;
divResponse.innerHTML += "<p>" + response + "</p>";
}
}

View 3 Replies View Related

How Disable The F5 Key In Mozilla

May 24, 2006

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?

<script>
document.onkeydown = function(){

if(window.event && window.event.keyCode == 116){
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 505){
return false;
}

}

</script>

View 7 Replies View Related

Mozilla DOM Element

Jul 3, 2006

I have a function which dynamically adds to a table. It receives a
variable which basically encapsulates this:

<div id="tableid">
<tr>
<td>col1</td>
<td>col2</td>
...
</tr>
...
</div>

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 &#391;') 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?

View 8 Replies View Related

DOM Problem In Mozilla

Jul 19, 2006

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 ...

View 2 Replies View Related

Mozilla: Not Enough Arguments

Jul 20, 2005

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>&nbsp;&nbsp;&nbsp;

Mozilla Javascript console window.

Error: uncaught exception: [Exception... "Not enough arguments
[nsIDOMXPathEvaluator.evaluate]" nsresult: "0x80570001
(NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: <unknown
filename> :: onclick :: line 0" data: no]

View 1 Replies View Related

Mozilla And SetInterval

Jul 20, 2005

Is some future Mozilla going to support setInterval ( <function:function>,
<interval:number> ) ?

Right now it seems to be simply setInterval ( <function-text:string>,
<interval:number> )

View 5 Replies View Related

Scripting Mozilla

Jul 20, 2005

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:

View 3 Replies View Related

Mozilla, XML And JavaScript

Jul 20, 2005

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.

View 2 Replies View Related

Innerxml For Mozilla

Jan 14, 2004

function maak(strXML){
var objDOMParser = new DOMParser();
var objDoc = objDOMParser.parseFromString('<xml>'+strXML+'</xml>', "text/xml");

while (this.hasChildNodes()) this.removeChild(this.lastChild);
var objImportedNode;
for (var i=0; i < objDoc.childNodes[0].childNodes.length; i++) {
switch (objDoc.childNodes[0].childNodes[i].nodeType){
case 3: objImportedNode = document.createTextNode(objDoc.childNodes[0].childNodes[i].data);
break;
default:
objImportedNode = document.importNode(objDoc.childNodes[0].childNodes[i], true);break;
}
this.appendChild(objImportedNode);
} //End: for
}

function getXML() {
var objXMLSerializer = new XMLSerializer();
var temp=this.childNodes.length-1;
var strXML=''
for (var i=0;i==temp;i++){

switch (this.childNodes[i].nodeType){
case 3: strXML+=this.childNodes[i].data.replace(/</g,'&lt;').replace(/>/g,'&gt;');
break;
default: strXML+=objXMLSerializer.serializeToString(this.childNodes[i]);
break;

}

}
return strXML;
}

Node.prototype.__defineGetter__("innerXML", getXML);
Node.prototype.__defineSetter__("innerXML", maak);

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.

View 3 Replies View Related

Disable The F5 Key In Mozilla?

Nov 18, 2009

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);

[Code]....

View 4 Replies View Related

Mozilla 3.3 Js Error / Get Rid Of This?

Mar 17, 2009

table.tBodies[0] has properties...

The js file works on NS 7 and IE but not mozilla 3.3... How to resolve it? code...

View 2 Replies View Related

Using $(this).children(a) With IE Vs Mozilla

Nov 3, 2010

The code below works fine in Firefox but doesn't work in IE8. Is that to be expected and if so, why?

if (($(this).children(a).text()) == 'Hide')

If I change it to -- if ($('.accordionShow .head a').text() == 'Hide') it works fine but I lose the ability to use 'this', which I would like to have.

The HTML is:

What I want to do is be able to identify the label as Hide or Show without getting the whole text, i.e. 'Hide the Section'. That way no matter what the label is it will work the same. And I could substring it I suppose by using the text of the <h2> tag but it seems that is unnecessary also.

Is this just another peculiarity of IE, that it doesn't use the .children(a) selector?

View 3 Replies View Related

Mozilla & Iframe

Jul 11, 2003

How to work with iframe in Mozilla? Where is it stored? I tried document.SomeIframe.src = "blah-blah"; not working.

View 1 Replies View Related

JavaScipt Mozilla

Nov 11, 2003

I'm currently experiencing a problem using ANY (!) JavaScript in Mozilla - nothing seems to be working. For example (from p2 of JavaScript 101 - Part 1):

javascriptpenWindow('/examples/js101/seefirst.html',400,200);

Causes the following error: openWindow is not defined.

I've also tried various other JavaScript examples and everything returns an error.

I'm tried two different PCs running Win2K and tried Mozilla 1.4 and 1.5. I've already checked that JavaScript is enabled for Navigator.

View 2 Replies View Related

Onload Event In Mozilla...

Jul 23, 2005

I am trying to rersize the window it works find in IE but doea not work with mozilla

window.attachEvent(onload,MWSOnLoad);
window.onload = function (MWSOnLoad)
{
alert('hello');
window.resizeTo(810,750);
top.outerWidth=810;
top.outerHeight=750;
}

<body marginwidth="0" marginheight="0" scroll="yes" onload="MWSOnLoad()">

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved