473,796 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JS code inside frameset..


can u put JS code inside a frameset? I have this, and it's not working,
even test alerts are ignored, in both browsers.. thank you..
Frances Del Rio
<frameset rows="90,*" border=0 frameborder="0" framespacing="0 ">
<frame name="header" src="header.htm l" scrolling="no" frameborder="0" >
<script language="Javas cript">
if(navigator.ap pName == "Netscape") {
alert('ha')
document.write( "<frameset cols='120,*' frameborder='0' framespacing='0 '>")
}
else {
alert('ha')
document.write( "<frameset cols='112,*' frameborder='0' framespacing='0 '>")
}
</script>

<frame name="nav" src="menu.html" scrolling="no" frameborder="0" >
<frame name="main" src="check_puid .jsp" scrolling="auto " frameborder="0" >
</frameset>

Jul 23 '05 #1
8 2728
Ron
Frances Del Rio wrote:

can u put JS code inside a frameset? I have this, and it's not
working, even test alerts are ignored, in both browsers.. thank you..
Frances Del Rio
<frameset rows="90,*" border=0 frameborder="0" framespacing="0 ">
<frame name="header" src="header.htm l" scrolling="no" frameborder="0" >
<script language="Javas cript">
if(navigator.ap pName == "Netscape") {
alert('ha')
document.write( "<frameset cols='120,*' frameborder='0'
framespacing='0 '>")
}
else {
alert('ha')
document.write( "<frameset cols='112,*' frameborder='0'
framespacing='0 '>")
}
</script>

<frame name="nav" src="menu.html" scrolling="no" frameborder="0" >
<frame name="main" src="check_puid .jsp" scrolling="auto " frameborder="0" >
</frameset>

script elements are not allowed in frameset elements ->
http://www.w3.org/TR/html401/present....html#h-16.2.1 . Put your
script in the head element instead.
Jul 23 '05 #2
bummer........
script elements are not allowed in frameset elements ->
http://www.w3.org/TR/html401/present....html#h-16.2.1 . Put your
script in the head element instead.
well, that's not of much use to me.. I need one frame with for Netscape
(N 4.7, I'm talking, hence the problem..) and another width for same
frame in IE.. thank you yr response.. Frances

Frances Del Rio wrote:

can u put JS code inside a frameset? I have this, and it's not
working, even test alerts are ignored, in both browsers.. thank you..
Frances Del Rio
<frameset rows="90,*" border=0 frameborder="0" framespacing="0 ">
<frame name="header" src="header.htm l" scrolling="no" frameborder="0" >
<script language="Javas cript">
if(navigator.ap pName == "Netscape") {
alert('ha')
document.write( "<frameset cols='120,*' frameborder='0'
framespacing='0 '>")
}
else {
alert('ha')
document.write( "<frameset cols='112,*' frameborder='0'
framespacing='0 '>")
}
</script>
<frame name="nav" src="menu.html" scrolling="no" frameborder="0" >
<frame name="main" src="check_puid .jsp" scrolling="auto " frameborder="0" >
</frameset>


Jul 23 '05 #3
Frances Del Rio wrote:
bummer........
?
> script elements are not allowed in frameset elements ->
> http://www.w3.org/TR/html401/present....html#h-16.2.1 . Put your
> script in the head element instead.


well, that's not of much use to me..


It is. Since you cannot use the "script" element within the "frameset"
element, but you *can* use it within the "head" element, you should do so.
See <40************ **@PointedEars. de>.
[Top post]


Please take heed of <http://jibbering.com/faq/#FAQ2_3>.
PointedEars
Jul 23 '05 #4
Lee
Frances Del Rio said:

bummer...... ..
script elements are not allowed in frameset elements ->
http://www.w3.org/TR/html401/present....html#h-16.2.1 . Put your
script in the head element instead.


well, that's not of much use to me.. I need one frame with for Netscape
(N 4.7, I'm talking, hence the problem..) and another width for same
frame in IE.. thank you yr response.. Frances


Tested in Netscape 7 and IE6:

<html>
<head>
<script type="text/javascript">
var cols=(navigator .appName == "Netscape")?120 :112;
var html=[
'<frameset rows="90,*" border=0 frameborder="0" framespacing="0 ">',
'<frame name="header" src="header.htm l" scrolling="no" frameborder="0" >',
"<frameset cols='"+cols+", *' frameborder='0' framespacing='0 '>",
'<frame name="nav" src="menu.html" scrolling="no" frameborder="0" >',
'<frame name="main" src="check_puid .jsp" scrolling="auto " frameborder="0" >',
'</frameset></frameset>'
];
document.write( html.join(""));
</script>
</head>
</html>

Jul 23 '05 #5
Lee wrote:
var cols=(navigator .appName == "Netscape")?120 :112;
var html=[
'<frameset rows="90,*" border=0 frameborder="0" framespacing="0 ">',
'<frame name="header" src="header.htm l" scrolling="no" frameborder="0" >',
"<frameset cols='"+cols+", *' frameborder='0' framespacing='0 '>",
'<frame name="nav" src="menu.html" scrolling="no" frameborder="0" >',
'<frame name="main" src="check_puid .jsp" scrolling="auto " frameborder="0" >',
'</frameset></frameset>'
];
document.write( html.join(""));


Nice one. But as for legibility of the resulting code, one should rather use

document.write( html.join("\n") );

And note that Array object initializers are not supported by all script
engines, so you may want to use

var html = new Array(
...
);

as well. However, browser sniffing does not work:

<http://pointedears.de/scripts/test/whatami>
PointedEars
Jul 23 '05 #6
On Fri, 28 May 2004 23:31:21 +0200, Thomas 'PointedEars' Lahn
<Po*********@nu rfuerspam.de> wrote:
Nice one. But as for legibility of the resulting code, one should rather use

document.write( html.join("\n") );


I'd recommend "" - the fewer redundant nodes you have in the DOM the
better - why would you be reading generated code anyway?

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 23 '05 #7
Lee
Thomas 'PointedEars' Lahn said:

Lee wrote:
var cols=(navigator .appName == "Netscape")?120 :112;
var html=[
'<frameset rows="90,*" border=0 frameborder="0" framespacing="0 ">',
'<frame name="header" src="header.htm l" scrolling="no" frameborder="0" >',
"<frameset cols='"+cols+", *' frameborder='0' framespacing='0 '>",
'<frame name="nav" src="menu.html" scrolling="no" frameborder="0" >',
'<frame name="main" src="check_puid .jsp" scrolling="auto " frameborder="0" >',
'</frameset></frameset>'
];
document.write( html.join(""));


Nice one. But as for legibility of the resulting code, one should rather use

document.write( html.join("\n") );

And note that Array object initializers are not supported by all script
engines, so you may want to use

var html = new Array(
...
);

as well. However, browser sniffing does not work:

1. During testing, I did join a newline, and alerted the result.
I changed it to "" and deleted the alert for release.

2. This is probably the first time I've used browser sniffing,
and did so only because the OP's requirement was to have a
different frame size in Netscape, specifically. Personally,
I would try to avoid such a requirement.

Jul 23 '05 #8
Jim Ley wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Nice one. But as for legibility of the resulting code, one should
rather use

document.write( html.join("\n") );
I'd recommend "" - the fewer redundant nodes you have in the DOM the
better -


Generally, agreed. But it is unlikely that someone
will access the top frameset element with the DOM.
why would you be reading generated code anyway?


To see that it worked.
PointedEars
Jul 23 '05 #9

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

Similar topics

8
3535
by: Hans | last post by:
Hi There, I have a page that has links with some variables and I need to open the results set in a frameset. I have tried doing this in various different ways, but still cannot get the variable passed to the relevant frames within the frameset. What is the best way of getting this done. Thanks Hans
1
2450
by: Mark Kuiphuis | last post by:
Now I have a question myself :) I am working on a website for a Hotel and on the first page we have a flash movie that shows the latest news items. The news items are retrieved from the database and shown in the movie. The news items do all have a summary and some of them can have a more detailed text. If there is detailed text available I want to open the detailed text of the news item, after clicking the item in the flash movie....
2
5096
by: luu duong | last post by:
I know this is probably easy but here is the details. I have an asp page that is not inside a frameset. I want to post data to another asp page that is inside a frameset. So firstpage.asp has action="response.htm" target="results". response.htm... <HTML> <FRAMESET ROWS="50%,50%"> <FRAME SRC="header.asp" NAME="fTop"> <FRAME SRC="another.asp" NAME="results">
1
11016
by: JP | last post by:
Hi, How can I create a dynamic frameset whose content changes based on user inputs? Specifically, how do I toggle a frame within a frameset? How can I allow a user to "close" or "dock" a frame by clicking on some button and let the parent update its frameset layout? What I've been trying to do is for the child frame to send a message
13
52212
by: Andrew C. | last post by:
Hello, I am in the process of trying to make some existing web pages comply with W3C's HTML 4.01 Recommendation ('strict' where possible, 'loose' where not -- i.e. when using framesets and, hence, the 'target' attribute of the <a> tag...) I have so far been unsuccessful in finding a compliant equivalent of the 'border' attribute of the <frameset> tag.
1
1736
by: Hartmut Dippon | last post by:
Hello, does anybody know how I can access and modify properties of my frameset within my code behind class, or is that not possible at all? I tried to find anything in the internet about this issue without any success. Can anybody give me a light on this issue? Thanks Hartmut
2
3951
by: Pat Sheen | last post by:
In IE6 I'm using the following html to have three frames. One of the frames is to open a locally stored MS Word document. <frameset rows="100,1*"> <frame name=SiteHdr src="Development\SiteHeader.html"> <frameset cols="50%,50%"> <frame name=Notes src="file://C:/Documents%20and%20Settings/NotesStarter.doc"> <frame name=Site src="http://www.google.com.au">
6
4353
by: BillE | last post by:
I have an aspx page which contains a frameset. I want to set the location.href of the frames dynamically using javascript created in the Page_Load of the frameset using RegisterStartupScript, but the registered script doesn't appear to run. Is there some reason why RegisterStartupScript won't work in a aspx page containing a frameset?
0
7337
by: joeller | last post by:
On October 13, 2006 Mark Rae wrote Hi, Firstly, I have not the slightest intention of using framesets - the reason for this post is merely to ask for assistance in furthering my understanding of XHTML. I was under the impression that XHTML fully supports framesets, hence the Frameset document type. Therefore, can anyone please tell me why the following markup doesn't validate correctly in VS.NET 2005?
0
9536
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
10468
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...
1
10205
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,...
0
10021
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
6802
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
5458
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...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
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
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.