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