473,748 Members | 5,230 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

link to iframe page (load specific content)

I have PAGE1 with the link to PAGE2 with iframe. (iframe load several
naked html). I want to add directive to the link to point sprcific
content of iframe.

to make it clear

link on PAGE1 -> load PAGE2 with iframe -> iframe content is specified
on link = whole PAGE2 with iframe with desired content...

Please help...

solving problem with creating several different PAGEs2 poining wanted
iframe src is not the case

SigRob

Oct 22 '05 #1
5 4573
VK
PAGE1:
<a href="foo.html? bar.html" target="PAGE1"> link</a>

PAGE2:
<body onload="iframeN ame.src=self.lo cation.search">

(iframeName loads bar.html)

Oct 22 '05 #2
I know we are close, but is not working yet...

---start.html---
<html>
<head><title>st art.html</title></head>
<body>
<a href="foo.html? bar.html" target="_self"> link</a>
</body></html>

----foo.html---
<html>
<head><title>fo o.html</title></head>
<body onload="frame.s rc=self.locatio n.search">
test frame to load specific content<br>
<iframe name="frame" height="300" width="300" align="middle" border="1"
frameborder="ye s" </iframe>
</body></html>

---bar.html---
<html><body>
if you see this inside frame it means script is working
</body></html>
state is: if you click on link foo.html is loaded with ?bar.html added
to address line - so far so good but somehow bar.html is not loading
into frame - frame stays empty.

One more issue - what will happen if frame has defined start page ie.
src=bar_start.h tml

thanx

Oct 23 '05 #3
VK
1) do not use "frame" as the name. "myFrame", "frame01" etc. are much
safer.

2) JavaScript specs state that location.search must contain characters
*following* the question mark (thus not *containing* it). Despite that
there is currently an implementation negligeance in some browsers when
the location.search is extracted together with "?" at the beginning.
Surprisingly enough FF is one of these browsers, at least it was.
Try alert(location. search) to see if your browser follows the specs. If
not, left-trim the string.
One more issue - what will happen if frame has defined start page ie.
src=bar_start.h tml

If you're expecting non-CGI chars in the file name, use
myFrame.src=une scape(location. search). You don't need to escape them in
the link: browser will do it for you.

Oct 23 '05 #4
What I wanted to say mentioning the question mark is your script is
working in halve way. In my opinion is giving direction to foo.html to
load bar.html but it is not happening. You can see this in the address
bar.
it looks like this --address/foo.html?bar.ht ml for me OK

I am not adding ? manually!!! Come on....

I have checked this on IE and FF with the same result bar.html is not
loading into frame.

Question about frame src arise in my mind because if you access
foo.html directly you might want to have a bar_start page loaded into
frame. I want! But from any other page I want to load specific content
to this frame. As soon as this script works I can cover loading
directly foo.html in the same way like others, because in this case
specified content of the frame will be bar_start page.

...just have to make this working

Oct 23 '05 #5
This is what the I like moust - it working...look on <body onload=
string

<html><head>
<title>foo.html </title>
</head>

<body onload="frame1. location.href = self.location.s earch.substr(1) ">

test frame to load specific content<br>
<iframe name="frame1" height="300" width="300" align="middle"
border="1"
frameborder="ye s"> </iframe>
</body></html>

let's spread it... thanks for your help VK! alert made the progress

Oct 24 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5006
by: Paul Brant | last post by:
Hi all, I have a page with an IFRAME in it. From a script in the main ( parent ) page I instruct the IFRAME to load a specific URL. The URL contains parameters that are processed by the server. The server then writes a result cookie into the content destined for the IFRAME. I am having issues accessing the cookie. If I use a debuger I can see the cookie via a quickwatch looking at window.frames.document.cookie however when I run the...
4
5512
by: seans | last post by:
Hi, Is there some way from preventing the JavaScript code in a document loaded into an iframe from executing? I don't have access to the pages being loaded into the i-frame so I can't modify then. They are being loaded from a server. thanks again. sean
2
23506
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an iframe on my page whose html has the refresh meta as follows : <meta http-equiv="refresh" content="10"> The iframe is effectivelyh refreshed every 10 seconds without having the
3
4488
by: PCgeek | last post by:
sorry moved this over to javascript forum, didn't mean to post 2x! Hi guys, I'm trying to put the finishing touches on my website and could really use some help on this particular issue. My page includes background music with a javascript music player on the main page below an iframe that is used for all content and navigation of the site and so that the music doesn't reload each time a page is switched. There is another javascript to resize...
4
2555
by: Drew | last post by:
This might beyond the scope of this group because it deals with SharePoint, but I'm not sure if I can't get it to work because of SharePoint or because JavaScript is weird (I don't have much experience with JavaScript). Anyway, here is the code i'm working with. Basically, it creates appends a hidden IFrame to the page, gets the links from the IFrame, and displays those which have the "OnLink" property. The weird thing is that when I...
2
5701
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 is in the main page. Is that possible? The code i have tried goes like much like this
7
9637
by: Tom Cole | last post by:
IFrames have been used by years for people to accomplish many of the tasks the XMLHttpRequest does for them now...I unfortunately am late in the game and XMLHttpRequest was already out there by the time I got serious about using Javascript for more than just rollover images... I now would like to learn about the concept for the purposes of creating Ajax-like requests across domains. I felt like I had the basic concept down, but am...
7
3971
by: SHC | last post by:
I'm in need of some javascript to load two pages into two seperate iframes which are on two seperate and different pages. Rather complicated I know (and easier done in one frameset), but caused by some limitation issues of SharePoint. To help:
11
4074
by: nma | last post by:
Hi How can I make the anchor link once I do onclick? <td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#00ff00" onMouseOver="this.style.background ='red'" onMouseOut="this.style.background='#00ff00'" onClick="window.frames.eventsDisplay.location = 'MB2eventlistTimeline.php?movieID=<?php echo $movie->movieID;?>&events=<?php echo $timeline->eventCategory;?>'; parent.playClip(<?php echo $timeline->eventID?>, <?php echo...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.