Solved

OnLoad

Posted on 2000-03-06
2
683 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
2 Comments
 

Accepted Solution

by:
yes4me earned 33 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

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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…

856 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