[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

OnLoad

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

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

Find out what you should include to make the best professional email signature for your organization.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Suggested Courses

834 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