?
Solved

Frame trouble!!  top.location=self.location;  without sends a submit to the server

Posted on 2004-09-14
8
Medium Priority
?
1,211 Views
Last Modified: 2008-01-09
I’m searching for something that works like this code:

if (top.location != self.location)
{
      top.location=self.location;
}

But I need that the browser doesn't do a submit to paint the page in the Top Frame.


My problem is:

I have a transactional site with 3 types of errors page.
-One of them is a  "Session Expired"
-Another page is a  "Technical Difficulties" (similar to a runtime error in VB). In this case the session is terminated too. But I need to send the "Technical Difficulties" page for know that was a Runtime Error.
-And Timeout page


My site works with frames, but a need that when happened an error, the error page show in the Top Frame. (The entire browser window)
The problem is when happened any error different to "Session Expired".


For example:

Mi server is a CGI (Edify) and this code   Y=1/0;    cause a Runtime error and I send "Technical Difficulties" page in a child frame.
Then the code in the "Technical Difficulties" page

if (top.location != self.location)
{
      top.location=self.location;
}

Sends a SUBMIT to refresh the top Frame with the Error page (Technical Difficulties) but how the session expired too then the server now sends the "Session Expired" error page, and that is wrong. In this case I need "Technical Difficulties" error page.
I need a code that do the function of the code show above but without send a SUBMIT to the server.

Is there any way to do this?

Thanks...
0
Comment
Question by:kikelpv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 1200 total points
ID: 12059983
Submit is reserved word for Form submission.
I understand that you want to show the content of some hidden frame at the top window, BUT withouth getting that page from server. Is that correct?
If yes, then you have to open a new window and copy there the content of your notification frame.
The empty window is opened like this:
<script>
ew=window.open("", "frameName");
ew.document.write(parent.frames.msgFrame.document.body.innerHTML);
</script>


0
 

Author Comment

by:kikelpv
ID: 12060304
OK, Zvonko

Yes, submit is a reserved word for Form submission.

I explain me wrong. I wanted to say that the code: (in Technical Difficulties page)

if (top.location != self.location)
{
     top.location=self.location;
}


Do that the browser go to the server again for the error page (Technical Difficulties) for paint it in the Top Frame.
But when the browser go to the server the session be expired then the server doesnt return the "Technical Difficulties" page, in its place sends "Session Expired" page.
For this reason the code doesnt work for me.
And I dont need to show the page in another window.

But your code was useful to find the answer.

This is the code that write the error page in the Top Frame without go to the server for the page.

if (top.location != self.location){
      top.document.write(document.body.innerHTML);
}

Thanks...




0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12061617
Fine that you solved your problem, but why the grading B?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:kikelpv
ID: 12064652
Sorry Zvonko,  this is the first time that I ask a question and I dont know extactly what was a grade. But I was watching the help and now I know what is.

Dont worry I will ask a moderator to change the grade.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12065640
Thanks.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12069501
Please have a look here: http:Q_21132118.html#12067992
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12077359
Thanks to both of you.

Zvonko
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question