Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-14
8
Medium Priority
?
1,214 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

618 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