How to show loading percentage of iframe tag with javascript? I am using iframe tag and my program takes some time to load my program. So I am thinking off to show the user how much it is being loaded yet now. I searched about it and I got to know that it's not possible to do it with HTML5, so I guess it can be done with js
EDIT:
<iframe width="800" height="600" src="https://www.greenfoot.org/scenarios/26460?embed=true" style="-webkit-transform:scale(0.4);"></iframe>
Related
I have created on my website an empty webpage, I name it NewGame.
I have an .html name itm.html and I want to make it run in small 300x300 screen on my page NewGame.html. As long as I didn't find anything how can I do that.
I have searched in here or google or I was trying to do with href but that will redirect me to another page and I don't want that to happen.
Is it possible to run itm.html inside another .html in small screen area, like a youtube small video?
Thanks in advance
If I understood you correctly, you should use an iframe.
<iframe src="/itm.html" width="300" height="300"></iframe>
Put that in NewGame.html. Since both HTML files are on the same domain, it will create a "window" into the other webpage.
You're going to want to read up on the venerable iframe element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
A quick example:
iframe.myCoolIframe {
width: 300px;
height: 300px;
}
<iframe class="myCoolIframe" src="https://example.com/itm.html"></iframe>
You can use the embed tag in html and style it to the size you want.
<embed src="https://www.w3schools.com/TAGS/tag_embed.asp" width="300" height="200">
My website consists of many pages in .svg format, wich are rather big files, is there any way to display some simple loading animation while my .svg pages load?
Note :
Please be aware that my question is for .svg page format file, not <html> pages. I already know how to put loading animation into <div id="loader"> and fade it out using JQuery, thank you....
what you mean "svg page fromat" ? svg can embed in html, like other embed resources, so you can show loader when starts svg loading and hide it after loading complete.
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" onload='load(evt)'>
and close loading in load function.
I'm trying to get the height from an external page that is inside an embed tag with jQuery.
I also need to resize the embed tag when the content inside changes in height. I tried using the following code but it doesn't seem to work. What would be the best approach for this case?
HTML
<html>
<body>
<embed src="www.example.com" height="100%">
</body>
</html>
JavaScript
$('#test').height()
$('embed').height()
After some hours I solved my problem with this:
cross domain
This saved my integration from my application in asp.net with WordPress.
Thanks for everybody that tried help me.
This may sound a bit confusing at first but I will try to explain. I am trying to access the code of an embed tag playing a youtube video inside an iframe and have it change the src on an outside iframe when the inner embed container is clicked.
note:the external frame is a full website in the background of the myframe player. myframe is a mock video player.
heres the basic way the document is set up
<body>
<iframe id='myframe' src='something.htm'></iframe>
<iframe id='externalFrame' src='external.htm'></iframe>
</body>
//external.htm
<body>
<embed id='mediaPlayer' src='somethingElse.htm' >
</body>
external javascript
var myPlayer=document.getElementById('myframe');
var externalFrame=document.getElementById('externalFrame');
externalFrame.contentWindow.document.getElementById('mediaPlayer').onclick=function(){
var mediaPlayer=externalFrame.contentWindow.document.getElementById('media_player');
myPlayer.src=mediaPlayer.src;
}
For the record I hate iframes with the passion of 1000 suns, and would never use them usually but for this the media player has to keep playing when the page changes. and Iframes are good for mimicking that.
That should work fine just make sure that the link to the src is directed to the correct place in the structure.
Explanation of problem in full below, you could probably just skip to the code at the bottom if you want.
What happened is a impatient client wanted his swf banners converted to html5 without having to actually code them from scratch. So i utilized Google's new tool, Swiffy. I then tried to place this new generated html5 page in the header of the clients wordpress site. I have gotten it to load as an iframe but the problem that I am encountering is when you click on a link on the loaded html5 page, it just loads the linked page in the iframe, not the parent page/window (which is to be expected). I tried a bunch of other methods, and tried changing the AS2 links in the .fla as well but no luck. I am guessing Swiffy can not read every AS2 code, and so it has been ignoring my "_blank", "_parent" when I use getURL. Anyway, I have been trying to get it so when the iframe unloads to go to the linked page, it uses Java to just open the link on the parent page. But iframes cant use the onunload event, but I am pretty sure framesets can. So this is the code I was trying and it doesnt work.
<frameset rows="100%" onunload="window.open('http://www.goaefis.com/about-aefis/what-is-aefis/','_parent');">
<frame src="www.goaefis.com/banner_Test.html" frameborder="0" scrolling="no" />
</frameset>
Any help will be super appreciated.
try to use the "target" on your frames.
Here's a example:
http://www.w3.org/TR/html4/present/frames.html