Navigate between different domains in iframe - html

I have an iframe that loads a website, then I have another button to be redirected to another site (with different domain). But, I am not getting what I want, when I click on the redirection button I just get a link:
<iframe src="https://FirstSite.com/">
#document
<html>
Found.
</html>
</iframe>
So, as you see, the second site is not being rendered. It's only creating a link (that doesnt even work, if I click it then it does nothing!)

As far as I understand... This is what I got...
<iframe src="https://FirstSite.com/" name="myFrame"></iframe>
<p>Found</p>

Related

Iframe isn't displayed in IE on some URLs

I have simple html code:
<iframe src="http://public.bullhornstaffing.com" width="500" height="700"></iframe>
<iframe src="http://public.bullhornstaffing.com/JobBoard/Standard/default.cfm?privateLabelID=9076" width="500" height="700"></iframe>
The first iframe displayed excellent in all browsers, but second iframe isn't displayed in IE instead of the page I see the text "Site Not Found. The site your are trying to find does not exist."
But when I try to open iframe url in the browser directly - everything works as it is necessary.
There is method to correct it?
The URL of the second iframe gets redirected to http://public.bullhornstaffing.com/JobBoard/Standard/BHContent_JobOpportunities.cfm and for some reason, the server responds to it differently when accessed on IE via iframe (or otherwise as embedded). What you get is technically a normal server response, just with special content.
It is at the discretion of server admin to do such things, e.g. in an attempt at preventing framing, though this behavior might be unintentional. Contact the server admin.

Facebook like button showing up but not working

I added a fb like button to my site through the fb generated iframe. It's rendering properly but when I click on it a pop-up appears and automatically closes after a few seconds and nothing happens. It's not liking anything. When I opened the page on my mobile and tried to like, thee button just turned into red text saying 'Error'. This is my iframe's code:
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2FmyDomain.com&width&layout=button_count&action=like&show_faces=false&share=false&height=21&appId=xxxxxxxxxxxxxxx" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:21px;" allowTransparency="true"></iframe>
I double-checked that I added the correct app ID, my app is not in testing mode and is open to the public. I also have the right domain set in the app's settings. Can some one tell me what I'm missing?
Facebook provides the like button with their own generated code(at least 2 years ago they were)
https://developers.facebook.com/docs/plugins/like-button (I'm at work so I don't know this is the right page,I can't open the page)
But their code should do the trick.

Prevent iframe from loading "src" page upon refreshing

I'm creating a static website and I am using iframes. The problem is, when I navigate to another page, say for example, this code for the iframe:
<iframe marginheight="0" align=top src="aboutus1.php" frameborder=0 scrolling=no border=0 WIDTH=800 framespacing=0 id="bodyframeid" name="bodyframename" onLoad="autoResize('bodyframeid');>" ></iframe>
The src attribute is pointing to aboutsus1.php. Now, when I navigate to another page, for example, I go to aboutus2.php then I reload the page, it goes back to aboutus1.php which is executed by src="aboutus1.php". My question is, how do I stay on the current page (aboutus2.php) even if I reload the page?
EDIT:
Click here for live example
Click the link above. First page you will see is About CTI. Now, try clicking on Partners menu then refresh the page. It goes back to About CTI page. How do I prevent it from going back to About CTI page when the page reload?
You could store the current page location in a session, and on reload load the url stored in the session. But you'd need some server side technology. In just html you don't store things. You might also be able to use a GET value.
You can't. By reloading the page you are loading a completely new page that just happens to come from the same resource as the previous page.
You can't avoid reloading the iframe when you are reloading the main page, but you can make it reload the same page again.
If you want to load a specific page in the iframe, you need to send information to the main page what to put in the iframe src. You can for example send that information in a query string, or put it in a cookie.
If you have in your iframe the documents from the same domain (same origin), or you can set the Access-Control-Allow-Origin headers on displayed page, you can detect iframe src change, and save the current URL (cookie, localStorage or anything you have), and restore it on page load.

Weird IFRAME issue, page blocks itself from loading

This is a weird one. I'm using the URL "http://www.craigslist.org/about/" as an example here.
I load up that page in my browser and modify it with Firebug. I add the following line right after the body tag:
<iframe src="http://www.craigslist.org/about/" id="frame1" name="frame1" width="100%;" height="200"></iframe>
The IFRAME shows as blank! Now when I load https instead of http in the IFRAME it works. At first I thought maybe craigslist doesn't allow itself to be embedded in an IFRAME at all. Then I tried embedding that same IFRAME code on my website and the frame loads as expected.
It's as if they are blocking you from loading the same page within itself!? Anyone ever seen this behavior before?
UPDATE:
This problem appears to be related to my browser. (Firefox 21) When I try to load any IFRAME that has the same exact URL as the parent frame it fails??

Making a story appear on facebook when user likes my website

I want a user to press this like button
and then for it to come up on their facebook that they like it. Currently when i press the like button nothing comes up on my Facebook whereas if i like something on another site it shows on my Facebook. This is my code for the facebook like button:
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.RexRApps.com&send=false&layout=button_count&width=450&show_faces=true&font&colorscheme=light&action=like&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
You cannot specifically tell Facebook to post something, it will only get more prominent if the user decides to add a comment too. The only thing you can do to make it more visible is to optimize the Open Graph Tags, check the URL in the debugger:
https://developers.facebook.com/tools/debug/og/object?q=www.RexRApps.com
(see "Warnings That Should Be Fixed" and check the "Object Properties". You should also refresh the info by putting the URL in the debugger again after you changed the OG tags.
And here´s some info about Open Graph tags:
http://ogp.me/
You don´t have a single OG tag on your website, that´s probably the reason why Facebook does not publish it correctly.