473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

problem with DIV tag in FireFox

I have a page that uses a some javascript and it works fine in IE but
fails to work in Firefox. Basically what I'm trying to do is have 3
iframes on a page but only displaying one of them at a time. A button
is displayed for the two iframes that are not displayed and when the
button is clicked, the corresponding iframe is shown and the other two
are closed and buttons for the closed iframes are then displayed.

Firefox says basically two things. 1) the div name i'm specifying is
not defined. I tried changing my reference from
emsframe.style='block' to document.emsframe.style='block' and this did
seem to fix that problem but then I get an error saying that the
object has no properties which is referring to the line: <div
id='emsframe' style='display: none'> as well as all the other lines
that define the iframes divisions.

I'm sure it's probably something simple that I'm missing but I don't
see it. any help would be greatly appreciated.

<html>
<head>

<style type="text/css">
input.mysearchterm{font-size: 10pt;font-weight: bold}
input.mybuttons{font-size: 10pt;font-weight: bold}
input.mycancelbuttons{font-size: 10pt;font-weight: bold;color: red}
input.myfindbutton{font-size: 10pt;font-weight: bold}
input.myheaderbutton{font-size: 10pt;font-weight: bold;width:
100%;text-align: right}
select.mysearchtype{font-size: 10pt;font-weight: bold}
</style>

<script language='JavaScript'>
var OpenWindow;

function setMyFocus()
{
document.myform.searchterm.focus();
document.myform.searchterm.select();
}

function openNewAtm()
{
openTmFrame();
mySearchHeader.style.display='none';
myMaintenanceHeader.style.display='block';
document.myform.editmode.value="ADD";
document.myform.target='subframe';
document.myform.action='newatm.asp';
document.myform.submit();
}

function openEmsFrame()
{
tmframe.style.display='none';
tmHeader.style.display='block';
emsframe.style.display='block';
emsHeader.style.display='none';
techframe.style.display='none';
techHeader.style.display='block';
setMyFocus();
}

function openTechFrame()
{
tmframe.style.display='none';
tmHeader.style.display='block';
emsframe.style.display='none';
emsHeader.style.display='block';
techframe.style.display='block';
techHeader.style.display='none';
setMyFocus();
}

function openTmFrame()
{
tmframe.style.display='block';
tmHeader.style.display='none';
emsframe.style.display='none';
emsHeader.style.display='block';
techframe.style.display='none';
techHeader.style.display='block';
setMyFocus();
}

function openEditAtm(theATMID)
{
//mySearchHeader.style.display='none';
//myMaintenanceHeader.style.display='block';
//document.myform.editmode.value='EDIT';
//document.myform.theid.value=theATMID;
//document.myform.target='subframe';
//document.myform.action='editatm.asp';
//document.myform.submit();
}

function openReports()
{
openTmFrame();
mySearchHeader.style.display='none';
myMaintenanceHeader.style.display='block';
document.myform.action='reports.asp';
document.myform.target='subframe';
document.myform.submit();
}

function getResults()
{
if (tmframe.style.display == 'none')
{
openTmFrame();
}

document.myform.action='search.asp';
document.myform.target='subframe';
setMyFocus();
document.myform.submit();

}

function refreshPage()
{
document.myform.action='index.asp';
document.myform.target='';
document.myform.submit();
}

function saveNewAtm()
{
document.myform.target='subframe'
document.myform.submit()
}

</script>
</head>

<body bgcolor='BOC4DE' onLoad='setMyFocus()'>

<form name='myform' method='post' onSubmit='setMyFocus()'
action='search.asp' target='subframe'>
<input name='editmode' type='hidden'>
<input name='theid' type='hidden'>

<div id='myMaintenanceHeader' style='display: none'>
<table border='1' width='750'>
<tr>
<td align='center'><br>
<input type='button' class='mycancelbuttons' value='Cancel and
Return to Search' onClick="refreshPage()">
<br><br></td>
</tr>
</table>
</div>

<div id='mySearchHeader' style='block'>
<table border='1' width='750'>
<tr>
<td>
<table width='100%'>
<tr>
<td align='left'>
<input type='button' value=' Reports ' onClick="openReports()"
class='mybuttons'>
</td>
<td>
<center><font=+2><b>Search By:&nbsp;&nbsp;</b></font>
<select name='searchtype' size='1' class='mysearchtype'
onChange='setMyFocus()'>
<option>ATMID
<option>RC Number
<option>Node Number
<option>Address
<option>Phone Number
</select></center>
</td>
<td align='right'>
<input type='button' value='New ATM' onClick="openNewAtm()"
class='mybuttons'>
</td>
</tr>
<tr>
<td colspan='3' align='center'>
<hr size='2' color='000000'>
<font=+2><b>Enter the Search Term and click
Find:&nbsp;&nbsp;&nbsp;</b></font>
<input type='text' name='searchterm' size='25' maxlength='20'
class='mysearchterm'>
&nbsp;&nbsp;&nbsp;
<input type='button' name='findbutton' value=' FIND '
onClick='getResults()' class='myfindbutton'>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>

<div id='tmHeader' style='display: none'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showTM' value='TESTMASTER '
onClick="openTmFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>

<div id='tmframe' style='display: block'>
<IFRAME src='search.asp' name='subframe' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>

<div id='emsHeader' style='display: block'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showEms' value='E M S '
onClick="openEmsFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>

<div id='emsframe' style='display: none'>
<IFRAME src='ems.asp' name='subframe2' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>

<div id='techHeader' style='display: block'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showTechs' value='TECHS '
onClick="openTechFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>

<div id='techframe' style='display: none'>
<IFRAME src='techs.asp' name='subframe3' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>

</form>
</body>
</html>
Jul 23 '05 #1
6 6069
On 10 Sep 2004 12:41:22 -0700, mike <si*********@hotmail.com> wrote:

[snip]
Firefox says basically two things. 1) the div name i'm specifying is
not defined. I tried changing my reference from emsframe.style='block'
to document.emsframe.style='block' and this did seem to fix that problem
but then I get an error saying that the object has no properties which
is referring to the line: <div id='emsframe' style='display: none'> as
well as all the other lines that define the iframes divisions.


You're being misled by IE. Using an id as a global variable will fail in
the majority of browsers as it's something that Microsoft just dreamt up.
Appending 'document.' doesn't really solve the problem. See the FAQ,
specifically section 4.41.

[snip]

Mike
clj FAQ
<URL:http://jibbering.com/faq/>

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
mike wrote:
I have a page that uses a some javascript and it works
fine in IE but fails to work in Firefox. <snip> I tried changing my reference from
emsframe.style='block' to document.emsframe.style='block' ...

<snip>

<URL: http://jibbering.com/faq/#FAQ4_41 >

Richard.
Jul 23 '05 #3
Lee
mike said:
Firefox says basically two things. 1) the div name i'm specifying is
not defined. I tried changing my reference from
emsframe.style='block' to document.emsframe.style='block' and this did
seem to fix that problem but then I get an error saying that the
object has no properties which is referring to the line: <div
id='emsframe' style='display: none'> as well as all the other lines
that define the iframes divisions.


Javascript errors never refer to lines of HTML code.
They'll be referring to some of the other places where you use
ID attributes as if they were global variables. IE allows that,
but it's the sort of really bad idea that only Microsoft seems
to be able to get away with.

document.getElementById("emsframe").style.display = ...

Jul 23 '05 #4
Michael Winter wrote:

You're being misled by IE. Using an id as a global variable will fail
in the majority of browsers [snip]


You also seem to be confused about what you are using. Most of the time,
you talk about <iframe>, but when it comes to Firefox you call them
<div> layers... which are they?
Jul 23 '05 #5
On Sat, 11 Sep 2004 14:39:40 +0100, Mark Preston
<us****@mpreston.demon.co.uk> wrote:
Michael Winter wrote:
You're being misled by IE. Using an id as a global variable will fail
in the majority of browsers [snip]


You also seem to be confused about what you are using. Most of the time,
you talk about <iframe>, but when it comes to Firefox you call them
<div> layers... which are they?


I didn't write anything about either of those topics. Perhaps you should
reply to the appropriate person and quote what they write, not mistakenly
accuse me of things I didn't do.

And by the way, I meant *prepending* 'document.' shouldn't solve the
problem.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #6
Michael Winter wrote:
On Sat, 11 Sep 2004 14:39:40 +0100, Mark Preston
<us****@mpreston.demon.co.uk> wrote:
Michael Winter wrote:
You're being misled by IE. Using an id as a global variable will
fail in the majority of browsers [snip]

You also seem to be confused about what you are using. Most of the
time, you talk about <iframe>, but when it comes to Firefox you call
them <div> layers... which are they?

I didn't write anything about either of those topics. Perhaps you
should reply to the appropriate person and quote what they write, not
mistakenly accuse me of things I didn't do.

And by the way, I meant *prepending* 'document.' shouldn't solve the
problem.

Mike, my message was to the OP - apologies for sending it as a reply to
your message (it should have included the OP quotes).
Jul 23 '05 #7

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

Similar topics

7
by: tagdance | last post by:
Hello friends, I have a very interesting problem with my css files and firefox - I guess ! Listen: I have set up my new website www.tagdance.de For testing purpose I have mirrored this...
7
by: Merlin | last post by:
Hi there, I have a serious problem with opening a new window with the help of JavaScript. The problem only occures with Firefox. Once you click on the item which fires up the open function, the...
3
by: cwdjrxyz | last post by:
I suggest that everyone using a recent version of Firefox read http://forums.mozillazine.org/viewtopic.php?t=315656&sid=b1db62861b8da29535c43e9c5c527c3b at once. This new security problem was...
13
by: Giggle Girl | last post by:
Hi there, I am having a problem with the behavior of Firefox, where lefthand column content is not resized properly after it is "collapsed" and then "re-expanded". An online demo is available...
7
by: Xah Lee | last post by:
Look at this page http://xahlee.org/emacs/wrap-url.html Look at it in Firebox, look at it in Safari, in Opera, and look at it in Microsoft Internet Explorer. The only fucked up case, is...
1
by: tinnews | last post by:
I'm running a python script via the apache ExtFilterDefine directive, it works basically as expected *except* that when I change the script apache/firefox continue to run the old version of the...
3
by: willyWEB66 | last post by:
Hi everyone, I'm having problem with the sequence of execution for xml.onload. It works fine if your not passing parameters to onload event but my code needs to pass parameter to its function. I'm...
8
by: Atemporal | last post by:
When I click the link of this group, it shows the followings errors. Cannot find comp.lang.c%2B%2B There is no group named comp.lang.c%2B%2B. * The link you followed may be broken or...
15
by: Mike Driscoll | last post by:
Hi, I've had this niggling issue from time to time. I want to create a shortcut on the user's desktop to a website that specifically loads Firefox even if Firefox is not the default browser. ...
6
by: Dennis | last post by:
I am in the process of converting some program output from HTML to XML/XSLT. I have an XSL stylesheet that inserts some javascript in the output that gets called further down to pop up a window)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...

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.