?
Solved

OnLoad

Posted on 2000-03-06
2
Medium Priority
?
687 Views
Last Modified: 2012-05-04
Whats the syntax for the OnLoad handler.
I want to load a page into another target frame, and pass it a query string.
Also how do you do this with framesets
0
Comment
Question by:rickyr
[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
2 Comments
 

Accepted Solution

by:
yes4me earned 132 total points
ID: 2589093
First you got your main frame... something like (this is the very simplify version of what I will write):


<HTML><frameset rows="200%,*">
<frame src="first_frame.html" name="first_frame">
<frame src="second_frame.html" name="second_frame">

</frameset>
<noframes>
Whatever you want here to display if the user doesn't have frame
</noframes>
</BODY></HTML>



Then you got your first frame with the following code:

<HTML><BODY>
<a href="some_html.html" TARGET="second_frame"
</BODY></HTML>


Clicking on the link of the first frame will load a page into the second frame.



Now to pass the query string to the next frame, you need to use something completly different. You need to use cookies... and that's tough if you are not use to it. Well you need first to set the cookie... something like:

function setCookie()
{

      var
the_name = prompt("What's your name?","");

      var the_cookie =
"wm_javascript=username:" + escape(the_name);

      document.cookie =
the_cookie;

      alert("Thanks, now go to the next
page.");

}

and retrieve it later on using:

function readCookie()
{

      var
the_cookie = document.cookie;

      var broken_cookie =
the_cookie.split(":");

      var the_name = broken_cookie[1];

      var
the_name = unescape(the_name);

      alert("Your name is: " +
the_name);

}


Of course, you need to place there function inside some javascript comments: <SCRIPT>... code here... </SCRIPT>
0
 
LVL 3

Author Comment

by:rickyr
ID: 2623261
Ta
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

801 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