|
-
December 10th, 2002, 08:05 AM
#1
Simple Problem
Hello Friends.
Can anybody tell me whats wrong in this code, its giving runtime error whenever i click the mainframe, rather than alert. Both mainFrame.htm and topmenu.htm are empty files
Code:
<html>
<head>
<title>
Testing Co-Browsing
</title>
<script language="javascript">
function ButtonClick()
{
alert("Hello");
}
</script>
</head>
<frameset rows="15%,85%">
<frame src="topmenu.htm" name="topmenu">
<frame src="mainframe.htm" name="mainwindow" onClick="ButtonClick()">
</frameset>
</html>
thanx
saddysan
-
December 11th, 2002, 10:11 AM
#2
try
alert("Hello")
without ";"
-
December 14th, 2002, 10:03 AM
#3
I tried out your code and with Netscape 7.0 it worked. It complained that it could not find topmenu.htm and mainframe.htm and filled both areas with white space but the click over mainframe.htm still activated the alert().
And the ";" at the end was unimportant, with or without netscape likes it.
However with IE 6.0 it complained about not finding the two pages and filled both areas with standard "not found" pages. And the click over the lower frame did not work.
Frames were originally introduced by Netscape and IE caught up with them in version 3. But many other browsers don't implement them at all I've heard.
It's a browser to browser question.
-
December 15th, 2002, 07:30 AM
#4
you could try putting the alert within mainframe.htm
-
December 17th, 2002, 03:56 PM
#5
The frameset is simply a double browser display. It's not going to be aware of events in the same way as a regular browser display.
What vickers_bits suggested is correct. In otherwords, the click event is taking place within "mainframe.htm" not the frameset.
Simply move your script function to mainframe.htm and motify your body tag in mainframe.htm according the example below, and all should work fine.
<body onclick="ButtonClick()">
Hope this helps...
JT
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|