473,473 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

help translate IE to firefox

i have a code snippet i pasted below, which works in IE, but not in firefox.
any help would be really appreciated. thanks.
<script language="JavaScript">
var url = external.menuArguments.document.URL;

// iterate over all iframes in given document and apply functions.
function visitFrames(doc, func)
{
var siteURL = "mysite.com";
var iframes = doc.all.tags("IFRAME");
var n = 0;

if (iframes != null) {
for (i = 0; i < iframes.length; i++) {
if (iframes[i].src.indexOf(siteURL) != -1) {
n++;
for (k = 0; k < func.length; k++)
func[k](iframes[i]);
}
}
}
return n;
}

function getCode(ifr) {
var p = "name=";
var l = p.length;
var s = ifr.src;
var i = s.indexOf(p);
if (i != -1) {
i += l;
c = s.substr(i);
j = c.indexOf('&');
if (j != -1) {
id = c.substring(0,j);
} else {
id = c;
}
}
}
Sep 11 '05 #1
1 1438
"doug s" <skyriverfly @ yahoo.com> writes:
i have a code snippet i pasted below, which works in IE, but not in firefox.
any help would be really appreciated. thanks. <script language="JavaScript">
Should be:
<script type="text/javascript">
The type attribute is required by HTML 4+ and is sufficient for all
browsers.
var url = external.menuArguments.document.URL;
I don't know what this does. It's definitly a proprietary IE feature.
....
Ok, MSDN says that it only works for scripts called from a custom
context menu entry. That might not be something you can do in Mozilla,
or other browsers.
// iterate over all iframes in given document and apply functions.
function visitFrames(doc, func)
{
var siteURL = "mysite.com";
var iframes = doc.all.tags("IFRAME");
The document.all is a proprietary IE feature. While Mozilla has recently
implemented it, there is still no reason to use it when the DOM methods
work just as well.

var iframes = doc.getElementsByTagName("IFRAME");
var n = 0;

if (iframes != null) {
if (iframes.length == 0) {
for (i = 0; i < iframes.length; i++) {
Remember to declare i as a local variable:

for (var i = 0; i < iframes.length; i++) {
if (iframes[i].src.indexOf(siteURL) != -1) {
n++;
for (k = 0; k < func.length; k++)
I assume "func" is an array declared elsewhere, which contains
at least the "getCode" function.
func[k](iframes[i]);
}
}
}
return n;
}

function getCode(ifr) {
Nothing IE specific in this function.
id = c.substring(0,j);


"id" is a global variable?
Good luck.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Sep 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: Spondishy | last post by:
Hi, I have a problem with divs and padding in IE6 and Firefox. Basically my example that I have attached works exactly how I want in IE6, but padding is treated differently in Firefox. My...
6
by: bobueland | last post by:
The module string has a function called translate. I tried to find the source code for that function. In: C:\Python24\Lib there is one file called string.py I open it and it says
1
by: Anjola | last post by:
I have gone so far entering the int, creating the list and displaying. How do I do thesummation part. //# include <iostream.h> //#include <conio.h> //# include <iomanip.h> # include "ListA.h" ...
1
by: Nestor | last post by:
Hello all, I'm begining in the web services world and I've reading about how to invoke them using javascript from Mozilla browser (version 2.0 in my case). I found a very interesting example...
9
bvdet
by: bvdet | last post by:
I have done some more work on a simple class I wrote to calculate a global coordinate in 3D given a local coordinate: ## Basis3D.py Version 1.02 (module macrolib.Basis3D) ## Copyright (c) 2006...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
9
by: Chrissy | last post by:
I took a C# class as an elective and received an incomplete in it and am desparate for help. I have two assignments left (arrays and inheritance) and would gladly pay anyone that can assist me with...
0
by: alaa123 | last post by:
please i really need help to make a start I need to write an XSLT script that takes a file as its input and produces bargraph as its output the file (input) svg:svg...
3
by: Kenneth McDonald | last post by:
I have the need to occasionally translate a single word programatically. Would anyone have a Python script that would let me do this using Google (or another) translation service? Thanks, Ken
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.