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

x
?
Solved

OnLoad

Posted on 2000-03-06
2
Medium Priority
?
689 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…

636 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