473,800 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does this not work in IE, but in Mozilla (and compatible)

I have the following (seemingly) useless piece of JavaScript

<html>
<head>

<script type="text/javascript">
function frameMe() {
s = "document.open( );";
s += "document.write ln('<html><fram eset rows=\"*,33%\"> ');\n";
s += "document.write ln('<frame src=\"' + document.locati on +
'\">');\n";
s += "document.write ln('<frame src=\"about:bla nk\">');\n";
s += "document.write ln('</frameset></html>');\n";
eval(s);
}
</script>

</head>

<body>
<input type="button" onClick="frameM e();" value="Frame me! (again?)">
</body>
</html>

Now, in Firefox this works fine, but in IE, it doesn't. Does anyone
know why, and if it can be helped?

Thanks,
Vincent
Jul 23 '05 #1
2 1487


Vincent van Beveren wrote:

<html>
<head>

<script type="text/javascript">
function frameMe() {
s = "document.open( );";
s += "document.write ln('<html><fram eset rows=\"*,33%\"> ');\n";
s += "document.write ln('<frame src=\"' + document.locati on +
'\">');\n";
s += "document.write ln('<frame src=\"about:bla nk\">');\n";
s += "document.write ln('</frameset></html>');\n";
Why no
document.close( );
call?
eval(s);
Why the eval, couldn't you simply have the function have
document.open() ;
document.write( ...);
document.close( );
calls?
</script>

</head>

<body>
<input type="button" onClick="frameM e();" value="Frame me! (again?)">
</body>
</html>

Now, in Firefox this works fine, but in IE, it doesn't.


Well what happens with IE, do you get a script error, or what exactly
doesn't work?


--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Vincent van Beveren wrote:
I have the following (seemingly) useless piece of JavaScript

<html>
<head>

<script type="text/javascript">
function frameMe() {
s = "document.open( );";
s += "document.write ln('<html><fram eset rows=\"*,33%\"> ');\n"; s += "document.write ln('<frame src=\"' + document.locati on +
'\">');\n";
s += "document.write ln('<frame src=\"about:bla nk\">');\n";
s += "document.write ln('</frameset></html>');\n";
eval(s);
}
</script>

</head>

<body>
<input type="button" onClick="frameM e();" value="Frame me! (again?)">
</body>
</html>

Now, in Firefox this works fine, but in IE, it doesn't. Does anyone
know why, and if it can be helped?

Thanks,
Vincent

Vincent,
Hmm...thats kinda neat....never thought of dynamically writing frames,
but it does seem to work. I worked out a way that works for firefox
and IE (see below). I tend to not like using frames since there are
usually other ways to do it without...but if you have some strange need
it could come in handy(I myself might have such a need). Eric

<html>
<head>

<script type="text/javascript">

function frameMe() {
document.write( '<html><framese t rows=\"*,33%\"> <frame name=\"main\"
src=\"net.htm\" ><frame src=\"testme

..htm\"></frameset></html>');
window.frames.m ain.location="n et.htm"
}
</script>

</head>

<body>
<input type="button" onClick="frameM e();" value="Frame me! (again?)">
</body>
</html>

Jul 23 '05 #3

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

Similar topics

2
3664
by: rnd | last post by:
Hi all! could you kindly help me to solve a compatibility problem that involves Internet Explorer and NN/Mozilla. I created a html page that contains a form (its name is "Modulo") and some text boxes. After clicking on a button, a popup appears. I tried to modify the text of "Testo" textbox from the popup windows by using the following javascript code: window.opener.Modulo.Testo.value=window.opener.Modulo.Testo.value + " This
8
2944
by: Nicolás Lichtmaier | last post by:
Hi, some time ago I've written an article about this issue. It explain some differences in Explorer's and Mozilla's JavaScript/DOM. It has recently changed its URL, This is the new one: http://www.reloco.com.ar/mozilla/compat.html Bye! PS: I hope it's useful to someone. I would appreciate any comments and suggestions!
2
3489
by: mark4asp | last post by:
Why does this not work in Mozilla ? <http://homepage.ntlworld.com/mark.pawelek/code/animals.html> The optHabitat_change() event does not fire. What am I doing wrong here? PS: It should repopulate the 2nd combo based upon the value of the selected item in the first, just like it does in IE.
2
1708
by: Aaron | last post by:
how can i make this compatible with Mozilla/Firefox or netscape? <span id="id1" onmouseover="id1.style.display = 'none'">dfdfd</span> the word disappears with mouse over in IE. Thanks
2
8229
by: James_patageul | last post by:
Hello people i would like to know what mean Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) so what browser it is and what OS it is thank a lot...
2
2135
by: Brett | last post by:
If you paste the URL used in this code into a browser, it will render without errors. Running the code puts it in the Catch with a Time out error but not always. I have ran both (see link below also) links through Xenu with no errors. Any idea why the code produces errors? Dim statuscode As String Dim wReq As WebRequest = WebRequest.Create("") Dim StartTick As Int32 Try
4
7723
by: th1421 | last post by:
Hi, I'm new to FireFox. I am currently trying to convert my website to be compatible with it. Doing so I’m trying to process some XML/XSLT pages (preferably without using JavaScript). When I view my XML pages using IE 6 or 7 it displays beautifully both accessed locally as through HTTP on my ISP’s server where I put them using FTP. When I view them in Mozilla FireFox 2.0, it displays ok when accessed locally. The CSS presentation –...
1
1904
by: mdbrown | last post by:
Hi guys, I have been searching for solutions, but in vain. Hope i'll be able to source for answers here from you guys, thanks in anticipation. I have this application that works fine in IE7, but not in mozilla. I have this left menu bar that is suppose to have a column with 2 sub menu. In IE7, the sub menu is able to be shown, but sad to say, in mozilla, it doesn't budge. My codes snippet being, <li class="top" id="clothes"><a...
2
5576
by: kailashchandra | last post by:
<html> <head> <title>PHP Test</title> </head> <body> <?php echo $_SERVER; ?> </body> </html>
0
9695
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
10514
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
10287
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...
1
10260
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7588
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6826
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
5479
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
4156
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
3
2956
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.