Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NETSCAPE 6.2 & FRAMES

 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code works fine in IE and NETSCAPE4.7 but it doesn't work in Netscape 6.2
Kindly let me know if I am missing something or Netscape doesn't like the way I coded .. your help is highly appreciated!
<html>
<head>
<script language="javascript" >
function fun(){
Frame1.document.write("<html>");
Frame1.document.write("<body>");
Frame1.document.write("<h1>Testing Frames </h1>");
Frame1.document.write("</body>");
Frame1.document.write("</html>");
}
</script>
<frameset frameborder=0 border=0 rows="110,*">
<frame frameborder=0 src="javascript arent.fun()" border=0 name="Frame1" scrolling="no" noresize marginwidth="0" marginheight="0">
<frame frameborder=0 src="/a.html" border=0 name="frame2" scrolling="no" marginwidth="0" marginheight="0" >
</frameset>
</head>
</html>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"doesn't work" isn't exactly the most thorough description of the nature of the behavior you are seeing.
Perhaps a better description of the nature of the undesirable behavior would allow more people to try and help you out.
bear
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for not giving proper explanation..

<html>
<head>
<script language="javascript" >
function fun1(){
alert(" inside fun1");
Frame1.document.write("<html>");
Frame1.document.write("<body>");
Frame1.document.write("<h1>TEST1</h1>");
Frame1.document.write("</body>");
Frame1.document.write("</html>");
}
function fun2(){

alert(" inside fun2");
frame2.document.write("<html>");
frame2.document.write("<body>");
frame2.document.write("<h1>TEST2</h1>");
frame2.document.write("</body>");
frame2.document.write("</html>");
}
</script>
<frameset frameborder=0 border=0 rows="100,*">
<frame frameborder=0 src="javascript arent.fun1()" border=0 name="Frame1" scrolling="no" noresize marginwidth="0" marginheight="0"> </frame>
<frame frameborder=0 src="javascript arent.fun2()" border=0 name="frame2" scrolling="no" marginwidth="0" marginheight="0" > </frame>
</frameset>
</head>
</html>

what this html page is supposed to do is.. throw a frameset with two frames and each frame should call the corresponding JavaScript function to create the content for that particular frame.
Kindly save this html file and try to open in IE and then Netscape 6.2 you will see the problem...
Netscape will not show anything..
kindly let me know if you are able to catch anything wrong with my code or with Netscape
thanks a lot in advance
 
Randall Twede
Ranch Hand
Posts: 4481
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ram,
shouldnt the following code be in the body not the head?

<frameset frameborder=0 border=0 rows="100,*">
<frame frameborder=0 src="javascript arent.fun1()" border=0 name="Frame1" scrolling="no" noresize marginwidth="0" marginheight="0"> </frame>
<frame frameborder=0 src="javascript arent.fun2()" border=0 name="frame2" scrolling="no" marginwidth="0" marginheight="0" > </frame>
</frameset>


I hate to say this but, your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
please register again with a valid name.
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Randall,
I changed my display name as per the policy sorry for overlooking it.
I tried as you said ..including the content with in <body> but that doesn't work.. what I found was the funcitons are not able recognize frame1.document and frame2.document ...
kindly help me if you have any idea.
Once again thanks
Ram
 
swaroop shastri
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<html>
<head>
<script language="javascript" >
function fun1(){
alert(" inside fun1");
Frame1.document.write("<html>");
Frame1.document.write("<body>");
Frame1.document.write("<h1>TEST1</h1>");
Frame1.document.write("</body>");
Frame1.document.write("</html>");
}
function fun2(){

alert(" inside fun2");
frame2.document.write("<html>");
frame2.document.write("<body>");
frame2.document.write("<h1>TEST2</h1>");
frame2.document.write("</body>");
frame2.document.write("</html>");
}
</script>
</head>
<frameset frameborder=0 border=0 rows="100,*">
<frame frameborder=0 src="javascript arent.fun1()" border=0 name="Frame1" scrolling="no" noresize marginwidth="0" marginheight="0"> </frame>
<frame frameborder=0 src="javascript arent.fun2()" border=0 name="frame2" scrolling="no" marginwidth="0" marginheight="0" > </frame>
</frameset>
</html>

Notice the </head> tag. There is also no need for a <body> tag. Hope it helps.
[ March 18, 2002: Message edited by: swaroop shastri ]
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swaproop,
hanks for your help!
Now I am trying to include a image and it is not working in Netscape 6.2 Kindly let me know if I am missing something
onceagain thanks a lot!
Ram

<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<script language="javascript" >
function fun1(){
var Out='';

Out ='<html>\n <head>\n <title>Header<\/title>\n <\/head>\n';
Out+=' <body bgcolor="green">\n';
Out+=' This is Header stuff.\n';
Out+=' <center>\n';
Out+='<form name=selfrm method=\"get\" ACTION=\"http://localhost:8080/servlet/myservlet" TARGET=\"Frame1\">\n';
Out+='<table WIDTH=\"100%\">\n';
Out+='<tr>';
Out+='<td><input type= \"submit\" value=\"frame2\"> <\/td>\n';
Out+='<\/tr>\n';
Out+='<\/form>\n';
Out+='<\/center>\n';

Out+=' <\/body>\n<\/html>\n';
alert( Out);
return Out;

}
function fun2(){
alert("inside fun2");
var Out='';

Out ='<html>\n <head>\n <title>Header<\/title>\n <\/head>\n';
Out+=' <body bgcolor="pink">\n';
Out+=' This is Header stuff.\n';

Out+='<a href= "">\n';

Out+='<IMG Valign=\"middle\" name=\"imgSubmit\" src=\"/deal/port/images/regular.gif\" width=\"82\" height=\"25\" border=\"0\" alt=\"Submit\"> </a>\n';
Out+=' <center>\n';

Out+='<form name=selfrm method=\"get\" ACTION=\"http://localhost:8080/servlet/myservlet\" TARGET=\"frame2\">\n';
Out+='<\/form>';
Out+='<\/center>';

Out+=' <\/body>\n<\/html>\n';


return Out;
}

</script>
</head>
<frameset frameborder=0 border=0 rows="100,*">
<frame frameborder=0 src="javascript:top.fun1()" border=0 name="Frame1" scrolling="no" noresize marginwidth="0" marginheight="0"> </frame>
<frame frameborder=0 src="javascript:top.fun2()" border=0 name="frame2" scrolling="no" marginwidth="0" marginheight="0" > </frame>
</frameset>
</html>
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swaroop,
FYI...please
I fortgot to tell you .. you mentioned abt </head> tag in your reply ..that works only in IE..not innetscape 6.2
netscape says Frame1.document has no properties
 
swaroop shastri
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing that the web server root is http://localhost:8080/.
In that case try accessing the image as http://localhost:8080/deal/port/images/regular.gif in netscape.
if you do not get the image then the location is in error.
But if you do get, then....
Ok, since the URL is relative and you are using javascript as the source of your frame, IE is intelligent enough to decipher the web site addr and direct the image request appropriately, while netscape is not? Try giving the complete web addr for the image.
One trick could be to use the location.href attr to get the web site addr?
I also have doubts of this escape char working across all browsers "\ /"
I would do this
Out+=' <\/body>\n<\/html>\n';
as
Out+=' </'+'body'+'>\n'+'<'+'/html'+'>\n';
Just a trick to get around confused browsers!
[ March 18, 2002: Message edited by: swaroop shastri ]
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Swaroop!
I tried to give the complete web path and it works fine in NE 6.2 .. but I can not live with that.... the reason being... my application should not be a server specific..as we are planning to migrate to so many different servers.. including a http://server ..will give lot of problems..
Today i checked the my web server log and I found the following info
when i tried to give
src=\"/deal/port/images/regular.gif\"
IE and netscape4.7 is able to find the gif but netscape 6.2 is throwing an HTTP 304 code ..like 404 for file not found
do you know what that means?
Your help is highly appreciated!
 
Randall Twede
Ranch Hand
Posts: 4481
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dont know how helpful this will be but i did a quick search on google for http error codes and found this
Not Modified 304
If the client has done a conditional GET and access is allowed, but the document has not been modified since the date and time specified in If-Modified-Since field, the server responds with a 304 status code and does not send the document body to the client.
Response headers are as if the client had sent a HEAD request, but limited to only those headers which make sense in this context. This means only headers that are relevant to cache managers and which may have changed independently of the document's Last-Modified date. Examples include Date, Server and Expires.
The purpose of this feature is to allow efficient updates of local cache information (including relevant metainformation) without requiring the overhead of multiple HTTP requests (e.g. a HEAD followed by a GET) and minimising the transmittal of information already known by the requesting client (usually a caching proxy).
here is the site i found it at
http://www.tnet.co.uk/support/error/
personally i hate netscape. everytime i have a problem with only one browser it is netscape. even its jvm doesnt work right. i was never able to get an applet to talk to a servlet in netscape. another problem had to do with using a depricated method caused netscape to hang
[ March 19, 2002: Message edited by: Randall Twede ]
 
swaroop shastri
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As i suspected, in my earlier post, Netscape has difficulty understanding the path since the frame src is a JS function. I would recommend that you not hard code the location, but use location.href to "intelligently" get the web server address. i.e parse it to get the server address and then append the image path! Hope this helps.
 
Randall Twede
Ranch Hand
Posts: 4481
3
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds like the way to go to me. swaroop, i hope you stay a regular here i might need your help someday too
 
swaroop shastri
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm now frequenting this ranch a lot !
Effect on the bottomline, during recession is apparent
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swaroop!
Great idea!! Thanks a bunch!
I reported this to mozilla, as of today a bunch of experts are seriously working on this .. I will keep you posted as soon as I get info from those experts!!

Once again thanks a lot for your time!
As randal said, stay with us in ranch..
ram
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randall/Swaroop,
I have the url by parsing the location.href
and it is available in a javascript var
var locationUrl = location.href;
As you told me this can be used to locate my img files,but this time instead of locating a img file i would like to post a req to my servlet
right now I give
<form name=selfrm method="get" ACTION="http://testserver1/servlet/TestServlet" TARGET="frame2">
i don't want to give http://testserver1/servlet/TestServlet

insted I would like to give
locationUrl+servlet/TestServlet
the reason being..i have 4 different servers and this particular servet is available in all 4 servers ..have the same HTML in all different servers...
is it possible for me to dynamically give the url in my FORM ACTION
Kindly let me know!
Your help is highly appreciated!
Ram
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randal/Swaroop,

I tried this and works fine! So I am able to dynamically change my ACTION URL ...
function sendForm() {
document.registerForm.action = 'action2';
return true;
}
</script>
<form
name="registerForm"
method="post"
action="action1"
onSubmit="return sendForm()">
<input type="text" value="some text">
<input type="submit" value="Submit">
</form>
onceagain thanks a lot guys for helping me out!
Ram
 
swaroop shastri
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great! This would have been the solution i would have given too!
 
ram ragu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swaroop/Randal,

I have a problem with using browser's BACK button in Netscape 6.2
I have 3 frames in my HTML page, the top 2 frames
always will have HTML stuffs and the 3rd frame will
have either a PDF or HTML document..
frame 1 is my portal LOGO... HTML page
Frame 2 is also HTML and it has form which has a
submit button when the user clicks on the button
I call my servlet which creates either a pdf or html
document and it goes to Frame 3
the problem is after my user clicks on the button I
render him the report and if he goes to someother url
and tries to comeback using browser BACK button.. he
is losing the content in my SECOND frame... do you
have any idea?
Thanks in advance for all your help!
Ram
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic