How to refresh parent page when i call iframe? - php

When successful submitting edit page through iframe, I want to refresh parent page.
Iframe code:
<iframe id="docframe" name="docframe" src="includedocinfo.php"
height="550" width="900px" scrolling="auto" frameborder="0" >
</iframe>

Parent location for reload parent from iframe
parent.location.reload();
Just see this link

Related

Change Embedded Gmaps iFrame SRC using AJAX

I'm trying to change the SRC of an iFrame using a URL retreived by AJAX from my backend database. I need the maps to change on click of a button.
The error showing inside the iFrame is " 404. That’s an error.
The requested URL //embed was not found on this server. That’s all we know." Which makes me think the SRC isn't being changed properly.
Any help on this would be great!
Heres my setup:
<iframe id="HTMLGmapsSRC" src="" width="300" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
var artgmaps = (imagesgmaps[index].replace(/\"/g, ""));
$('#HTMLGmapsSRC').attr('src', artgmaps);
The JSON response has added backslashes however i've read this is normal?
I Used this method for the embed data in iframe.
$location = "Address which is get from the data base".
<div id="show_map" style="display:block;">
<address class="row"><?php echo $location;?></address>
</div>
and use address tag for show map
$("address").each(function(){
var embed ="<iframe width='100%' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?&q="+ encodeURIComponent( $(this).text() ) +"&output=embed'></iframe>";
$(this).html(embed);
});

capture follow subscription on facebook on follow button click

I am using facebook follow button. how can i capture that whether user successfully followed page or not in jquery or javascript?
below are my iframe code
<iframe id="facebookIf" src="https://www.facebook.com/plugins/follow.php?href=https%3A%2F%2Fwww.facebook.com%2Fzuck&width=78&height=65&layout=button&size=large&show_faces=true&appId" width="78" height="65" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>

iframe inside iframe and get information from parent using PHP

eBay auction with the following code:
<iframe width="1416" height="3384" frameborder="0" id="desc_ifr" src="http://adomain.com/mainframe">
<h1>the content</h1>other content
<iframe src="http://another_domain.com/frame.php">
</iframe>
</iframe>
Through the frame.php content, I would like to go back to the parent frame with id desc_ifr for find keywords inside the H1 tags and do something when found.
Thanks.

How to show files in iframe by Jquery or JavaScript and prevent to show in another page loading?

Here is my problem, I had describe in code project. When I am clicking in an icon it try to open in new page for showing image or pdf or video. But, I don't like this. I like to show that files in my iframe in same page. How can I do this ?
My code project link is:
Please don't open in new page. Just stay in same page.
I could suggest using a plugin as it makes things easier.
http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
Alternatively what you want is to change the iframe src.
Using jQuery, you could for example, do something like this
<iframe id="myframe" style="display:none" width="630" height="420"></iframe>
<div class="fileIcon">
<a class="click" onClick="" rel="gallery" href="#">
<img src="src" title="" width='100' height='100' alt="" />
</a>
</div>
And JS
$('a').click(function(e){
e.preventDefault()
var s = $(this).find('img').attr('src');
$('#myframe').attr('src', s).show();
});
FIDDLE
This will get the image src and more it to the iframe
Give your iframe a name="myframe" then in your target you would use target="myframe"

How to redirect Iframe to another URL php

I have parent page index.php and inside it i have iframe like below
<div id="main-content1" style="position:absolute;float:none;top:80px;margin-left:170px;width: 830px;">
<iframe onload="IfarmeOnload();" style="display:block; margin-left:none; margin-right:none; width: 100%; height: 100%;" src="<?php echo $home; ?>" id="rightMenu" name="rightMenu" frameborder="0"></iframe>
</div>
when i click on the link that located in Parent window i want to redirect iframe content to according to that URL.
Then once Iframe loaded sucessfully i want redirect whole index.php page only once
EDIT
i tried this
echo "<script> document.getElementById('rightMenu').contentWindow.location='http://www.google.lk'</script>";
but this is redirecting to google.lk to not loading inside the ifamme
Give your iframe a name:
<iframe name="myIframeName"></iframe>
Reference your iframe in desired hyperlinks with the target attribute:
I do not seat by the computer but I think
You need something like that
Document.getElementById("rightMenu").location.href
Or try this one
iframeobj.src = url
Or the same code that you wrote but without contentwindow

Categories