473,836 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.getEle mentById stopped working after adding an iframe

AC
I had a page that does some event setup on window.onload:

function prepEvents()
{
document.getEle mentById("menum ap_sales").onmo useover =
swapMenuSales;
// etc
}

window.onload = prepEvents;
worked great, until the page where this javascript src is loaded now
contains an iframe. It seems that the document.getEle mentById() call
is returning null now. If I remove the iframe, it all works again.

Presumably it's something to do with having multiple documents now,
but how do I access the one I want?

Thanks for your help!

Andy C
Jun 30 '08 #1
10 3786
SAM
AC a écrit :
I had a page that does some event setup on window.onload:

function prepEvents()
{
document.getEle mentById("menum ap_sales").onmo useover =
swapMenuSales;
// etc
}

window.onload = prepEvents;
worked great, until the page where this javascript src is loaded now
contains an iframe. It seems that the document.getEle mentById() call
is returning null now. If I remove the iframe, it all works again.

Presumably it's something to do with having multiple documents now,
but how do I access the one I want?
only one ID of same name in a page !

you can't acces file loaded in iframes if this file is from another
domain that the main file.

Jun 30 '08 #2
AC
>
only one ID of same name in a page !
yep there are no repeated ids.
you can't acces file loaded in iframes if this file is from another
domain that the main file.
agreed. Both are in the root of my site. HTML goes like this:
<html>
<script language="JavaS cript" type="text/javascript" src="script/
menu.js"></script>
<body>
<form>
<div id="pagebody">
<div id="loginlinks" >
<iframe src="chat.html" frameborder="0" scrolling="no"
id="chatFrame" name="chatFrame " />
</div>
</div>
</body>
</html>

Could it be something to do with timing? i.e. the onload event is
being called before the DOM object is ready???

I'm completely at a loss at the moment; adding an iframe should be the
easy bit...

Help!
TIA,
AC
Jun 30 '08 #3
SAM
AC a écrit :
>only one ID of same name in a page !

yep there are no repeated ids.
>you can't acces file loaded in iframes if this file is from another
domain that the main file.

agreed. Both are in the root of my site. HTML goes like this:
<html>
<script language="JavaS cript" type="text/javascript" src="script/
menu.js"></script>
<body>
<form>
what is this opening form tag ?
(with nowhere a closing one)
<div id="pagebody">
<div id="loginlinks" >
<iframe src="chat.html" frameborder="0" scrolling="no"
id="chatFrame" name="chatFrame " />
</div>
</div>
</body>
</html>

Could it be something to do with timing? i.e. the onload event is
being called before the DOM object is ready???

I'm completely at a loss at the moment; adding an iframe should be the
easy bit...

is it the main page which gets the onload function ?

I see nowhere the element 'menumap_sales' ... !
--
sm
Jun 30 '08 #4
On Jun 30, 3:25*pm, SAM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
AC a écrit :
[snip]
you can't acces file loaded in iframes if this file is from another
domain that the main file.
agreed. *Both are in the root of my site. *HTML goes like this:
<html>
Where is the head tag?

* * <script language="JavaS cript" type="text/javascript" src="script/
menu.js"></script>
* * <body>
* * * * <form>

what is this opening form tag ?
(with nowhere a closing one)
Good question.
* * * * <div id="pagebody">
* * * * * * <div id="loginlinks" >
* * * * * * * * <iframe src="chat.html" frameborder="0" scrolling="no"
id="chatFrame" name="chatFrame " />
* * * * * * </div>
* * * * </div>
* * </body>
</html>
Could it be something to do with timing? *i.e. the onload event is
being called before the DOM object is ready???
I'm completely at a loss at the moment; adding an iframe should be the
easy bit...
Validate the HTML first.

My friend who works at Yahoo came to me for help last week. All of a
sudden things "stopped working" so she asked for my help.

It turned out that there was another developer who "owned" the
autocomplete part of the app. Yahoo does everything in a totally
retarded way status reports, no testing, and isolated cowboy coding.
They call this "Scrum" and balance it out with lots of middle
management.

The autocomplete code had something along the lines of:

document.body.i nnerHTML = "<div id='wrapper'>" +
document.body.i nnerHTML +
"</div>";

This caused the problem of all nodes refs being wiped out, so where
she had:-

var button = document.getEle mentById('butto n'),
title = document.getEle mentById('title ');
bar.onclick = function() {
// Error: title is null or not an object
title.style.dis play = "";

</script>

<script src="autocomple te.js"></script>

An IFRAME is perfectly capable of adding such scripts to the page, and
it's entirely possible that your iframe has a script that does that.

Garrett
is it the main page which gets the onload function ?

I see nowhere the element 'menumap_sales' ... !
Yeah. Post the real code.
--
sm
Jun 30 '08 #5
dhtml wrote:
On Jun 30, 3:25 pm, SAM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
>AC a écrit :
>>>you can't acces file loaded in iframes if this file is from another
domain that the main file.
agreed. Both are in the root of my site. HTML goes like this:
<html>

Where is the head tag?
The `<head>' start tag of the `head' _element type_ is optional, as is the
`</head>' end tag of the same.

<http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#h-7.4.1>
<http://www.w3.org/TR/1999/REC-html401-19991224/index/elements.html>
>> <script language="JavaS cript" type="text/javascript" src="script/
menu.js"></script>
<body>
<form>
what is this opening form tag ?
(with nowhere a closing one)

Good question.
It is not Valid, the required `action' attribute is missing.

<http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#edef-FORM>

But in this case both appear to be unnecessary.
My friend who works at Yahoo came to me for help last week. All of a
sudden things "stopped working" so she asked for my help.

It turned out that there was another developer who "owned" the
autocomplete part of the app. Yahoo does everything in a totally
retarded way status reports, no testing, and isolated cowboy coding.
They call this "Scrum" and balance it out with lots of middle
management.
If true, this would shed some serious doubt about the code quality of YUI.
(I should probably peer-review it soon.)
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Jun 30 '08 #6
AC

OK here's all the code (I'd omitted repetitions and the obvious bits
for brevity). It's come from an ASP.net page so you'll have to work
around the asp bits I'm afraid...

[HTML]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Page title</title>
<link href="ActiveSty le.css" rel="stylesheet " type="text/css" />
<link href="MenuStyle .css" rel="stylesheet " type="text/css" />
<script language="JavaS cript" type="text/javascript" src="script/
menu.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div id="pagebody">
<div id="logo">
<asp:Image ID="imgLogo" runat="server"
EnableTheming=" False"
EnableViewState ="False" ImageUrl="~/images/
BITS_200x123.pn g" />
</div>
<div id="loginlinks" >
<asp:Literal ID="litDate" runat="server"
EnableViewState ="False" Mode="PassThrou gh"></asp:Literal><br />
<!--
* * * * * * * * * * * * * * * * * * * * * *
*
* this is the iframe that breaks the javascript....
*
<iframe src="chat.html" frameborder="0" scrolling="no"
id="chatFrame" name="chatFrame " /-->
*
* * * * * * * * * * * * * * * * * * * * * *
</div>
<div id="navmenu">
<img src="images/menu.png" id="navmenuimg "
usemap="#menuma p" alt="Main menu" />
<map name="menumap" id="menumap" >
<area shape="rect" coords="0,0,140 ,20" href="#"
id="menumap_ite m1" alt="1" />
<area shape="rect" coords="0,21,14 0,40" href="#"
id="menumap_ite m2" alt="2" />
<area shape="rect" coords="0,41,14 0,60" href="#"
id="menumap_ite m3" alt="3" />
<area shape="rect" coords="0,61,14 0,80" href="#"
id="menumap_ite m4" alt="4" />
<area shape="rect" coords="0,101,1 40,120" href="#"
id="menumap_ite m5" alt="5" />
</map>
</div>
<div class="navmenu_ spacer_top">
</div>
<div id="navmenu_ite m1" class="navmenu_ sub1">
<a href="#" name="navmenu_i tem1_0_link"
id="navmenu_ite m1_0_link" onmouseover="sw apMenu('navmenu _item1_0_img',
item1Images[0][1].src);" onmouseout="swa pMenu('navmenu_ item1_0_img',
item1Images[0][0].src);"><img src="images/menu_item1_0.pn g"
id="navmenu_ite m1_0_img" alt="1.1" title="1.1" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem1_1_link"
id="navmenu_ite m1_1_link" onmouseover="sw apMenu('navmenu _item1_1_img',
item1Images[1][1].src);" onmouseout="swa pMenu('navmenu_ item1_1_img',
item1Images[1][0].src);"><img src="images/menu_item1_1.pn g"
id="navmenu_ite m1_1_img" alt="1.2" title="1.2" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem1_2_link"
id="navmenu_ite m1_2_link" onmouseover="sw apMenu('navmenu _item1_2_img',
item1Images[2][1].src);" onmouseout="swa pMenu('navmenu_ item1_2_img',
item1Images[2][0].src);"><img src="images/menu_item1_2.pn g"
id="navmenu_ite m1_2_img" alt="1.3" title="1.3" /></a><a href="#"></a>
</div>
<div class="navmenu_ spacer">
</div>
<div id="navmenu_ite m2" class="navmenu_ sub1">
<a href="#" name="navmenu_i tem2_0_link"
id="navmenu_ite m2_0_link" onmouseover="sw apMenu('navmenu _item2_0_img',
item2Images[0][1].src);" onmouseout="swa pMenu('navmenu_ item2_0_img',
item2Images[0][0].src);"><img src="images/menu_item2_0.pn g"
id="navmenu_ite m2_0_img" alt="2.1" title="2.1" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem2_1_link"
id="navmenu_ite m2_1_link" onmouseover="sw apMenu('navmenu _item2_1_img',
item2Images[1][1].src);" onmouseout="swa pMenu('navmenu_ item2_1_img',
item2Images[1][0].src);"><img src="images/menu_item2_1.pn g"
id="navmenu_ite m2_1_img" alt="2.2" title="2.2" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem2_2_link"
id="navmenu_ite m2_2_link" onmouseover="sw apMenu('navmenu _item2_2_img',
item2Images[2][1].src);" onmouseout="swa pMenu('navmenu_ item2_2_img',
item2Images[2][0].src);"><img src="images/menu_item2_2.pn g"
id="navmenu_ite m2_2_img" alt="2.3" title="2.3" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem2_3_link"
id="navmenu_ite m2_3_link" onmouseover="sw apMenu('navmenu _item2_3_img',
item2Images[3][1].src);" onmouseout="swa pMenu('navmenu_ item2_3_img',
item2Images[3][0].src);"><img src="images/menu_item2_3.pn g"
id="navmenu_ite m2_3_img" alt="2.4" title="2.4" /></a><a href="#"></a>
</div>
<div class="navmenu_ spacer">
</div>
<div id="navmenu_ite m3" class="navmenu_ sub1">
<a href="#" name="navmenu_i tem3_0_link"
id="navmenu_ite m3_0_link" onmouseover="sw apMenu('navmenu _item3_0_img',
item3Images[0][1].src);" onmouseout="swa pMenu('navmenu_ item3_0_img',
item3Images[0][0].src);"><img src="images/menu_item3_0.pn g"
id="navmenu_ite m3_0_img" alt="3.1" title="3.1" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem3_1_link"
id="navmenu_ite m3_1_link" onmouseover="sw apMenu('navmenu _item3_1_img',
item3Images[1][1].src);" onmouseout="swa pMenu('navmenu_ item3_1_img',
item3Images[1][0].src);"><img src="images/menu_item3_1.pn g"
id="navmenu_ite m3_1_img" alt="3.2" title="3.2" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem3_2_link"
id="navmenu_ite m3_2_link" onmouseover="sw apMenu('navmenu _item3_2_img',
item3Images[2][1].src);" onmouseout="swa pMenu('navmenu_ item3_2_img',
item3Images[2][0].src);"><img src="images/menu_item3_2.pn g"
id="navmenu_ite m3_2_img" alt="3.3" title="3.3" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem3_3_link"
id="navmenu_ite m3_3_link" onmouseover="sw apMenu('navmenu _item3_3_img',
item3Images[3][1].src);" onmouseout="swa pMenu('navmenu_ item3_3_img',
item3Images[3][0].src);"><img src="images/menu_item3_3.pn g"
id="navmenu_ite m3_3_img" alt="3.4" title="3.4" /></a><a href="#"></a>
</div>
<div class="navmenu_ spacer">
</div>
<div id="navmenu_ite m4" class="navmenu_ sub1">
<a href="#" name="navmenu_i tem4_0_link"
id="navmenu_ite m4_0_link" onmouseover="sw apMenu('navmenu _item4_0_img',
item4Images[0][1].src);" onmouseout="swa pMenu('navmenu_ item4_0_img',
item4Images[0][0].src);"><img src="images/menu_item4_0.pn g"
id="navmenu_ite m4_0_img" alt="4.1" title="4.1" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem4_1_link"
id="navmenu_ite m4_1_link" onmouseover="sw apMenu('navmenu _item4_1_img',
item4Images[1][1].src);" onmouseout="swa pMenu('navmenu_ item4_1_img',
item4Images[1][0].src);"><img src="images/menu_item4_1.pn g"
id="navmenu_ite m4_1_img" alt="4.2" title="4.2" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem4_2_link"
id="navmenu_ite m4_2_link" onmouseover="sw apMenu('navmenu _item4_2_img',
item4Images[2][1].src);" onmouseout="swa pMenu('navmenu_ item4_2_img',
item4Images[2][0].src);"><img src="images/menu_item4_2.pn g"
id="navmenu_ite m4_2_img" alt="4.3" title="4.3" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem4_3_link"
id="navmenu_ite m4_3_link" onmouseover="sw apMenu('navmenu _item4_3_img',
item4Images[3][1].src);" onmouseout="swa pMenu('navmenu_ item4_3_img',
item4Images[3][0].src);"><img src="images/menu_item4_3.pn g"
id="navmenu_ite m4_3_img" alt="4.4" title="4.4" /></a><a href="#"></a>
<a href="#" name="navmenu_i tem4_4_link"
id="navmenu_ite m4_4_link" onmouseover="sw apMenu('navmenu _item4_4_img',
item4Images[4][1].src);" onmouseout="swa pMenu('navmenu_ item4_4_img',
item4Images[4][0].src);"><img src="images/menu_item4_4.pn g"
id="navmenu_ite m4_4_img" alt="4.5" title="4.5" /></a><a href="#"></a>
</div>
<div class="navmenu_ spacer">
</div>
<div id="navmenu_bla nk" class="navmenu_ sub1">
</div>
<div class="navmenu_ spacer">
</div>
<div id="navmenu_ite m5" class="navmenu_ sub1">
<img src="images/menu_item5_0.pn g"
id="navmenu_ite m5_0_img" alt="Main contact phone number" title="Main
contact phone number" /><a href="#"></a>
<img src="images/menu_item5_1.pn g"
id="navmenu_ite m5_1_img" alt="Main fax number" title="Main fax
number" /><a href="#"></a>
<a href="#" name="navmenu_i tem5_2_link"
id="navmenu_ite m5_2_link" onmouseover="sw apMenu('navmenu _item5_2_img',
item5Images[2][1].src);" onmouseout="swa pMenu('navmenu_ item5_2_img',
item5Images[2][0].src);"><img src="images/menu_item5_2.pn g"
id="navmenu_ite m5_2_img" alt="Enquiries email address"
title="Enquirie s email address" /></a><a href="#"></a>
<img src="images/menu_item5_3.pn g"
id="navmenu_ite m5_3_img" alt="Out of hours mobile" title="Out of hours
mobile" /><a href="#"></a>
</div>
<div id="pagecontent ">
<asp:ContentPla ceHolder id="PageContent PlaceHolder"
runat="server" >
</asp:ContentPlac eHolder>
</div>
</div>
</form>
</body>
</html>

[/HTML]

[chat.html]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Whatever </title>
<link href="ActiveSty le.css" rel="stylesheet " type="text/css" />
</head>
<body>
<h1>Whatever</h1>
</body>
</html>

[/chat.html]

[menu.js]
function getElementsByCl ass(searchClass , node, tag)
{
var classElements = new Array();

if (node == null)
node = document;

if (tag == null)
tag = '*';

var els = node.getElement sByTagName(tag) ;
var elsLen = els.length;
var pattern = new RegExp("(^|\\s) " + searchClass + "(\\s|$)");
for (i = 0, j = 0; i < elsLen; i++)
{
if (pattern.test(e ls[i].className) )
{
classElements[j] = els[i];
j++;
}
}

return classElements;
}

function showGeneric(tar getClass, targetId)
{
var i;
var classElements = getElementsByCl ass(targetClass ,
document.form1) ;

// hide all of these
for (i = 0; i < classElements.l ength; i++)
classElements[i].style.visibili ty = "hidden";

if (targetId)
{
// find the one we're interested in showing
var targetElem = document.getEle mentById(target Id);
if (targetElem)
targetElem.styl e.visibility = "visible";
}
}

function swapMenu(target Id, srcUrl)
{
var targetObj = document.getEle mentById(target Id);
if (targetObj)
targetObj.src = srcUrl;
}

function swapMenuImage(m enuImageUrl, menuId, subMenuId, subMenuClass)
{
swapMenu(menuId , menuImageUrl);
showGeneric(sub MenuClass, subMenuId);
}

function createMenuArray (normalUrl, hoverUrl)
{
var arrayOut = new Array(2);

arrayOut[0] = new Image();
arrayOut[1] = new Image();
arrayOut[0].src = normalUrl;
arrayOut[1].src = hoverUrl;

return arrayOut;
}

function preLoadImages()
{
imgItem1 = new Image();
imgItem2 = new Image();
imgItem3 = new Image();
imgItem4 = new Image();
imgItem5 = new Image();

// main menu
imgItem1.src = "images/menu_item1.png" ;
imgItem2.src = "images/menu_item2.png" ;
imgItem3.src = "images/menu_item3.png" ;
imgItem4.src = "images/menu_item4.png" ;
imgItem5.src = "images/menu_item5.png" ;

// first menu
item1Images = new Array();
item1Images[0] = createMenuArray ("images/menu_item1_0.pn g",
"images/menu_item1_0_ho ver.png");
item1Images[1] = createMenuArray ("images/menu_item1_1.pn g",
"images/menu_item1_1_ho ver.png");
item1Images[2] = createMenuArray ("images/menu_item1_2.pn g",
"images/menu_item1_2_ho ver.png");

// second menu
item2Images = new Array();
item2Images[0] = createMenuArray ("images/menu_item2_0.pn g",
"images/menu_item2_0_ho ver.png");
item2Images[1] = createMenuArray ("images/menu_item2_1.pn g",
"images/menu_item2_1_ho ver.png");
item2Images[2] = createMenuArray ("images/menu_item2_2.pn g",
"images/menu_item2_2_ho ver.png");
item2Images[3] = createMenuArray ("images/menu_item2_3.pn g",
"images/menu_item2_3_ho ver.png");

// third menu
item3Images = new Array();
item3Images[0] = createMenuArray ("images/menu_item3_0.pn g",
"images/menu_item3_0_ho ver.png");
item3Images[1] = createMenuArray ("images/menu_item3_1.pn g",
"images/menu_item3_1_ho ver.png");
item3Images[2] = createMenuArray ("images/menu_item3_2.pn g",
"images/menu_item3_2_ho ver.png");
item3Images[3] = createMenuArray ("images/menu_item3_3.pn g",
"images/menu_item3_3_ho ver.png");

// forth menu
item4Images = new Array();
item4Images[0] = createMenuArray ("images/menu_item4_0.pn g",
"images/menu_item4_0_ho ver.png");
item4Images[1] = createMenuArray ("images/menu_item4_1.pn g",
"images/menu_item4_1_ho ver.png");
item4Images[2] = createMenuArray ("images/menu_item4_2.pn g",
"images/menu_item4_2_ho ver.png");
item4Images[3] = createMenuArray ("images/menu_item4_3.pn g",
"images/menu_item4_3_ho ver.png");
item4Images[4] = createMenuArray ("images/menu_item4_4.pn g",
"images/menu_item4_4_ho ver.png");

// fifth menu
item5Images = new Array();
item5Images[0] = new Image();
item5Images[0].src = "images/menu_item5_0.pn g";
item5Images[1] = new Image();
item5Images[1].src = "images/menu_item5_0.pn g";
item5Images[2] = createMenuArray ("images/menu_item5_2.pn g",
"images/menu_item5_2_ho ver.png");
item5Images[3] = new Image();
item5Images[3].src = "images/menu_item5_0.pn g";
item5Images[4] = new Image();
item5Images[4].src = "images/menu_item5_0.pn g";

}

function swapMenu1()
{
swapMenuImage(i mgItem1.src, "navmenuimg ", "navmenu_item1" ,
"navmenu_sub1") ;
}

function swapMenu2()
{
swapMenuImage(i mgItem2.src, "navmenuimg ", "navmenu_item2" ,
"navmenu_su b1")
}

function swapMenu3()
{
swapMenuImage(i mgItem3.src, "navmenuimg ", "navmenu_item3" ,
"navmenu_sub1") ;
}

function swapMenu4()
{
swapMenuImage(i mgItem4.src, "navmenuimg ", "navmenu_item4" ,
"navmenu_su b1")
}

function swapMenu5()
{
swapMenuImage(i mgItem5.src, "navmenuimg ", "navmenu_item5" ,
"navmenu_su b1")
}

function prepEvents()
{
// main menu
document.getEle mentById("menum ap_item1").onmo useover = swapMenu1;
document.getEle mentById("menum ap_item2").onmo useover = swapMenu2;
document.getEle mentById("menum ap_item3").onmo useover = swapMenu3;
document.getEle mentById("menum ap_item4").onmo useover = swapMenu4;
document.getEle mentById("menum ap_item5").onmo useover = swapMenu5;

}

function windowLoad()
{
preLoadImages() ;
prepEvents();
}

window.onload = windowLoad;

[/menu.js]
[MenuStyle.css]
#navmenu img
{
border:0px;
}

..navmenu_sub1
{
height:17px;
visibility:hidd en;
vertical-align:top;
}

..navmenu_sub1 img
{
border:0px;
}

#navmenu_blank
{
}

..navmenu_space r_top
{
height:8px;
}

..navmenu_space r
{
height:3px;
visibility:hidd en;
}

[/MenuStyle.css]
Phew!

Thanks for the assistance,
AC
Jul 1 '08 #7
AC meinte:
OK here's all the code (I'd omitted repetitions and the obvious bits
for brevity). It's come from an ASP.net page so you'll have to work
around the asp bits I'm afraid...
[hundreds of lines snipped]

Thanks for shortening. Anyway, I doubt that anybody will look into it.
Reading phone books provides better entertainment.

Gregor
--
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Jul 1 '08 #8
AC wrote:
OK here's all the code (I'd omitted repetitions and the obvious bits
for brevity).
I don't see anyone asking for it. Especially not me, whose posting
you have nonsensically replied to. Please read and take heed of
<http://www.jibbering.c om/faq/#FAQ2_3>.
It's come from an ASP.net page so you'll have to work
around the asp bits I'm afraid...
You will have to work through it by yourself, I'm afraid. Understand that
there is no point in your posting server-side code if you have a client-side
problem like this one.

And there is no point in serving XHTML to a UA that does not support it,
like MSHTML. (However, I don't know if XHTML is a requirement for ASP .NET.)
[more than 400 lines of almost completely uncommented source code]
Phew!
Yes, indeed. You must be kidding (and badly at that), dumping core here.
Thanks for the assistance,
ISTM you are looking for someone to do your homework, in their
free time, for free. This is definitely the wrong place for that.

<http://catb.org/~esr/faqs/smart-questions.html>
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Jul 1 '08 #9
AC
I don't know if you've read the original post, but it asked how to
reference elements when the page includes an iframe. The original code
was posted to demonstrate how elements were being referenced in the
page without an iframe, that worked. The long code was posted when it
was asked for. Maybe I replied to the wrong person - apologies if
that's the case.

Never mind, thanks anyway.
Jul 1 '08 #10

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

Similar topics

3
2453
by: Jan Ebbe Jensen | last post by:
Hi I have tried the following code. It works in Mozilla. In IE I'm not able to enable DesignMode? What have I done wrong? It says that obj is undefined? Can anyone help me please.
4
1760
by: Eduard Witteveen | last post by:
Hello, I want to make a hooverbox, which is shown when the mousepointer is not moved for a amount of time. When the hooverbox is shown, i will do a server request to retrieve the information for the hooverbox. I was thinking of using document.onmousemove and a infinit running while loop comparing the mouse positions. Is this the way to solve it?
3
9281
by: davidkarlsson74 | last post by:
Error: document.getElementById("folderMenu").cells has no properties File: http://www.volkswagen.se/tillbehor/js/foldermenu.js Rad: 49 The function activates different DIV:s, but doesn't seem to work on FireFox or Netscape. What could be wrong? The function: function setActiveTab(tabNo) {
7
9768
by: Asterbing | last post by:
Hi, Talking about a js script which changes an iframe src through a "ref_to iframe.setAttribute("src", document_path);", I would like to launch a check() fct when this new document is loaded. Of course, knowing, I don't want (and can't n some cases where document is generated by a cgi script) to edit every possible document which is potentially loadable in the iframe.
8
52832
by: Henrik Stidsen | last post by:
I am trying to access a table in an iframe via javascript. It sounds easy - but it won´t work... The iframe is added to the document via someContainerElement.innerHTML = "<iframe...>", it has name and ID and its visible in my DOM explorer just as the table I need is it. The table is added from ASP.NET via Response.Write(). I have tried both window.frames, document.getElementById and even document.getElementsByTagName, nothing has...
2
13812
by: Steven | last post by:
I have a page(pg1) which contains a select list (list1) in a form(form1) and an iframe(frame1), in this iframe is a page(pg2) with another select list(list2) in a form(form2) and I transfer the contents of list2 to list 1 as follows function transfer(){ for (var i=0; i<document.form2.list2.length; i++){ var cf=document.form2.list2; addOption(parent.document.form1.list1, document.form2.list2.value, document.form2.list2.value);
4
2648
by: dr1ft3r | last post by:
Hey guys, I'm building a site for a landscaping business down the street and can't seem to get part of the code functioning correctly. The code fails on line 68 where I make a reference to an iframe's src property. Being that IE does not follow standard and considers an id, name, etc as a qualifying identifier for the document.getElementById object, I double checked to make sure that there's only one instance of id = "servif" and I never use...
8
7212
by: removeps-groups | last post by:
Is there any way to control the space between top of browser or frame and document body? What I have is this: There is a simple file test1.html, and file test.html that displays test1.html in an iframe. On the iframe I set marginheight and marginwidth to zero. But there is one line of blank space between the top border of the iframe and the first line of text. However, the iframe's content document's body's offsetHeight gives the...
0
9825
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9671
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10852
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10553
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10255
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9382
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6980
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4459
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.