473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Call to page and load IFRAME

How would I encode a URL on home.htm to open another page (index1.htm) which contains an Iframe with name="test" and id="test" and load it with include1.htm or include2.htm which resides in the same directory as index1.htm.

------------------------
Example: (button 1 needs encoding)

home.htm -> button 1 -> links to index1.htm

Index1.htm -> iframe name and id="test"

iframe "test" -> displays one of two includes as defined by button 1 encoding
Oct 27 '06 #1
3 8805
How would I encode a URL on home.htm to open another page (index1.htm) which contains an Iframe with name="test" and id="test" and load it with include1.htm or include2.htm (load variables by url or javascript) which resides in the same directory as index1.htm.

------------------------
Example: (button 1 needs encoding)

home.htm -> button 1 -> links to index1.htm

Index1.htm -> iframe name and id="test"

iframe "test" -> displays one of two includes as defined by button 1 encoding
Oct 27 '06 #2
How would I encode a URL on home.htm to open another page (index1.htm) which contains an Iframe with name="test" and id="test" and load it with include1.htm or include2.htm which resides in the same directory as index1.htm.
------------------------
Example: (button 1 needs encoding)
home.htm -> button 1 -> links to index1.htm
Index1.htm -> iframe name and id="test"
iframe "test" -> displays one of two includes as defined by button 1 encoding
You can do this easily with a querystring that passes the URL to load as follows:

First, add JavaScript to the header of index1.htm:
(note that test is the name/id of your iframe element)

<script type="text/javascript">
function loadIframe()
{
var urlStr;
urlStr = location.search.slice(1);
window.frames.test.location = urlStr;
}
</script>

Next, call the function in the body onload:

<body onLoad="loadIframe()">

Then, in the home page, make links that use a querystring to pass the info:

<a href="index1.htm?page1.htm">Page 1</a>
<a href="index1.htm?page2.htm">Page 2</a>

Now, the links go to the page with the iframe, the function parses out the page passed by the query string, and sets the src of the text iframe with it. You can just have src="" on the page, as it's going to get reset anyway.

-Skarjune
Nov 17 '06 #3
revata
1
My use of this is slightly different than Dennis'. I'm using the iframe as the main content area on index.php. and i'ts working well for loading specified content from the url [ www.mysite.com/index.php?content.php ]

However when i just go to "www.mysite.com" the onLoad function loops and loads a bunch of index.php pages in my iframe.

How can I make it default to loading "home.php" into the iframe unless there is a query present in the url string?
Aug 20 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul | last post by:
HI! how do we load a page from the menu into an iframe when you are not on the iframe page? I want to be able to load pages (options in my menu ) into a iframe no matter if I am on the iframe...
18
by: J-T | last post by:
Hi All, There is a picture on the following URL which I want to have it in one of my asp.net pages .I mean I want to embed the content of this page in my own page and get its image.Is there a...
2
by: Rob | last post by:
Hi Gang: I have a page that loads a remote page into an IFRAME. I don't have any control over this remote page though the page is owned by the same company I work for. The problem is that all...
18
by: Mark | last post by:
Hello. I am looking for a way to download and cache a web page that the user has not yet requested, and write the web page to the browser cache without displaying it. My intention is to improve...
2
by: hgl1976 | last post by:
Hi! I have a web page that from a query that loads the search result into an iframe on the page. In the search result inside the iframe i would like to be able to load content into div tag that...
1
by: epower | last post by:
Hello, I am working on an ASP .NET application in Visual Studio 2005 and running IE7. This application has a page that contains an iframe which loads an .aspx page and hyperlinks that...
5
by: BerlinBrown | last post by:
Do you know if it is possible to wait for the iframe page to load and then manipulate the iframe DOM. E.g. mypage: <script> function myinit() { theiframe.location = "iframe_with_frames.html"...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
6
by: Revathi Balakrishnan | last post by:
i am trying to disable some of the anchor tags which are linked with particular onmouseover and onmouseout events.i have written a javascript function.when i called this function on load of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.