I got a situation here. I have a main page and a subpage. The subpage does have an iframe container and there are two pages test1.htm and test2.htm that are loaded into that iframe when your current page is "subpage.htm".
However, what I want to to, is to be able to click on a link on my main page and it opens up the subpage and automatically loads a predefined page, lets say test1.htm into the iframe.
I got the function to load a page into an iframe and I though by using JavaScript and some code this was possible. Unfortunately, I couldn't figure out a way to do this.
function link {
url = '../subpage.htm';
document.target = url;
loadintoiframe(myiframe,test1.htm);
}
I got the function loadintoiframe, it needs the name of the iframe and the page to load.
When I call the function link() as a href link on the main page, it does load the subpage, but it does not load the iframe correctly.
Maybe someone can help me out?
Why not just put
Link
And avoid the JavaScript at all?
So this does not work.
I tried to go for a JavaScript Method that just does a href basically and then calls the method that loads my special page into that iframe on the href site.
That did not work, so anyone else got a clue how I can href a different .htm site and simultaniously tell that site to load a certain page into the iframe?
Best regards,
Alex
Related
I have an internal page on my site that contains an iframe. The content inside the iframe consists of 3 pages, a.htm, b.htm, and c.htm. By default, a.htm loads when I visit the page containing the iframe.
On the homepage of my site, there are 2 links...one links to content on b.htm, the other to content on c.htm. So when one of these links are clicked, I need to load the page on my site that contains the iframe, with either b.htm or c.html showing inside it, depending on which link was clicked.
I know basic PHP, but I'm struggling to find a way to pass the iframe content into the frame from an external page. Or would jQuery be better suited for this? I've looked through a lot of submissions about this, but haven't found an answer that works for me yet. Any help would be greatly appreciated.
Is there a way to load whole new URL / page inside my site element so that you can interact with that page without refreshing my page? It's not a problem if it initially has to load with page refresh.
jQuery.load()?
jQuery.ajax()?
All I could find online was loading parts of your own site and there was no info about using that loaded page without refresing your own page. Example:
jQuery(document).ready(function() {
jQuery("#dynamic").load("single.php");
});
I've previously loaded new pages inside modal but I need it inside div or anything else without "overlay".
I think you are trying to inject content from another domain.
that means you want a part of your page load another domains content.
this page demonstrates the issue very clearly. take a look there and read the answers carefully.
I am trying to use Iframes and or PHP to hide a link that is dynamically created. The link is being created in php. But when I try to access that link from within an iframe it takes over the whole page. The site loads, but the idea is that if it was in an iframe the url could be hidden and the user could click multiple items with out having to enter all their form data in every time.
I've tried using the link as a header and using php commands like:
$remote = fopen( $URL, "r");fpassthru($remote);
where $URL was my link.
a sample of the link is:
http://fb-zc-0.cafe.zynga.com/current/iframe//mfs_sent.php?ids=2&tab_clicked=All&request_id=236973056431070&gid=3014&today=1&time=3&ref=gift_today&cafe_token=OAlF7gSlMbQxAtBhvnprTzNhIww8H7Aq2z9i3KJwGWmJzUQfxZ8b9/kFWMVqN62JUihQA06VtuuoKoxmosK6JIPKWTMl0oQecLb+0e0HSAk3S32f5BCI7xhYB9SflOnN&from_page=SUNRISE_BREAKFAST_1&kingdom=quest&phylum=baklava&uid=342&sendkey=8e4aa1a75594c47cc61aee301efff90e$$ccF(NUP,67jiH3QM7!nspE0W8d8KprzD5,Za77bp34G*S_ST)*ilx)F7Y)acC4xj971Kkswxx2OM3eij3z1h0M3eij3z1h0&mode=quest_asking&quest_key=SUNRISE_BREAKFAST_1&mfs_time=3&snood=1&ajax=true&limiter_channel=rsvp&limiter_type=build_a_carnival3+5
Any help would be appreciated.
If you have links outside of this iFrame and want them to load into that iFrame on the same page, you'll have to give it a name, then target the named iFrame within your link's href.
<iframe src="http://google.com" name="myframe" hieght="100" width="100"></iframe>
<br/>
Test.
However, if you're loading a page into your iFrame that's loading links with target="blank", then those will go to a new window; unless you don't have access to those pages, you won't be able to change the links (short of writing JS to dive into your iFrame, etc).
What I currently have:
index.php: Mainpage, showing topbar, navigation & placeholder for content
navigation: uses javascript to load a php-file into the content-section from index.php if a link in the navigation is clicked; important: NO refresh of index.php
Is working fine right now. Also the url in the address bar is not being changed right now when clicking a link.
What should be added:
If a link in the navigation is clicked, javascript should still load a php-file but also should change the url in the address bar without refreshing the side.
Example:
url: "www.example.com
In navigation link "work" is clicked.
work.php is loaded into the content-section of index.php
url now: "www.example.com/work
Additionally if the user types www.example.com/work in the address bar index.php should load work.php without a link being clicked.
A good example to understand my issue with the url in the address bar is facebook. Hope I could clarify my problem so somebody is able to help me ;-)
You can only change the hashtag of a URL without refreshing the page (making another request).
So when a navigation link is clicked you could change "www.example.com" to "www.example.com/#work" but you can't change it to "www.example.com/work" without reloading the page.
A hashtag can get set with javascript using window.location.hash
window.location.hash = "work";
If you are looking to avoid hashtags, you can use the HTML5 history API. This allows you to have the / in your pages using the history.pushState() and history.replaceState() method.
There is also this plugin that you may find useful.
I am using an iframe under which another small application is running on. In one certain page of the iframe, I try to redirect the url to parent's index page. But if I am using header('location:fullpath/index.php'). then it is redirecting to the mentioned page, but within the iframe. I need it will be opened beyond the iframe. Could you please help me to fix up this issue?
If you don't want to use javascript and you have control over the target page, you can put this metatag at the top of the target page and it should open in a new window.
<META HTTP-EQUIV="Window-target" CONTENT="_blank">
Here is a list of the other CONTENT options you can try as I'm not certain what beyond the iframe means.
Same Frame -_self
Whole Page -_top
New Window -_blank
Parent Frame-_parent