javascript and iframe not supported in browsers other than IE - javascript

I run a simple html file with an iframe and javascript working fine in IE Browser, but it is not working in other browsers like safari,firefox.
In safari the Iframe box is only displayed, but the content in that is not shown.
Please clarify why safari doesn't support it? what are the alternatives for iframe?

You can use <embed> tag ,which behaves like iframe
Here is example
<!doctype html >
<html >
<head>
<title>embed Tag </title>
</head>
<body>
<p><b>Example of embed tag in HTML5.</b></p>
<embed src="http://www.w3schools.com" height="300" width="300" />
</body>
</html>
While you can also use iframes on all browser
Here is example
<!DOCTYPE html>
<html>
<body>
<iframe src="http://www.w3schools.com">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Are you trying to do any different for iframe ?

Related

how to remove the pdf download icon that was opened through iframe

I want to remove that download icon that is in the PDF viewer, but I can't. I'm opening the pdf through an iframe. Here is an example of my code below:
<html>
<head>
<title>Disable Context Menu</title>
</head>
<body oncontextmenu="return false">
<iframe id="pdfFrame" width="500px" height="600px" src="png.pdf"></iframe>
</body>
</html>
First I tried to apply a style inside the page opened by the iframe, but I couldn't succeed in that.
Change:
<iframe id="pdfFrame" width="500px" height="600px" src="png.pdf"></iframe>
In:
<iframe id="pdfFrame" width="500px" height="600px" src="png.pdf#toolbar=0"></iframe>
Hope that helped!
You cannot simply change the view of a PDF when you placed it in the Distributed Network System (WorldWideWeb) it became just the same as EVERY item in the Public Domain an embedded object for download and view.
You can make suggestions as to how those dis-positions may be handled (see how I suggested via a fragment the second frame could be #toolbar=0) but once you publish html objects they are no longer yours to control.
Most browsers will come with their own editors to remove that just as easy as you can add it.
There are ways google can make it more difficult to extract the source PDF copy but if the client can view it a copy has already been gifted (dis-possessed) to them.
<html>
<head>
<title>Disable Context Menu</title>
</head>
<body oncontextmenu="return false">
<iframe id="pdfFrame" width="500px" height="600px" src="https://docs.google.com/viewerng/viewer?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true"></iframe>
</body>
</html>

Iframe format for embedding

I'm trying to embed a 360 panorama tour into Adobe portfolio I brought this from visor but adobe portfolio just supports Iframe format :
<script src="/scripts/embed.js" data-vizorurl="https://patches.vizor.io/embed/mahmoudgfx/makarm_villa_a" ></script>
Could this above code to be converted into Iframe embed?
Regarding...
"...Adobe Portfolio just supports Iframe format"
If Portfolio accepts it, then just try making an Iframe like this :
<iframe src="https://patches.vizor.io/embed/mahmoudgfx/makarm_villa_a" width="800" height="600">
PS: A fully testable HTML code example (to confirm Iframe works naturally) :
<!DOCTYPE html>
<html>
<body>
<iframe src="https://patches.vizor.io/embed/mahmoudgfx/makarm_villa_a" width="800" height="600">
</body>
</html>

Kaltura embedded iframe player error on Firefox

I'm trying to embed a video from Kaltura Video Platform in a HTML5 page.
I followed the docs at Kaltura. So far I'm able to play the video in Safari, Chrome and Internet Explorer but it fails to load in Firefox. The firebug console shows this javascript error:
ReferenceError: kWidget is not defined
The HTML5 code demostrating the issue follows (see fiddle for a live demo):
<!DOCTYPE html>
<html>
<head>
<title>test</title>
</head>
<body>
<iframe id="iframe_-1" src="http://www.kaltura.com/p/403921/sp/40392100/embedIframeJs/uiconf_id/4438451/partner_id/403921?iframeembed=true&playerId=iframe_-1&entry_id=1_40ttmxyq" width="400" height="330" allowfullscreen webkitallowfullscreen mozAllowFullScreen frameborder="0">
Video Platform
Video Management
Video Solutions
Video Player
</iframe>
</body>
</html>
What puzzles me is that only Firefox is complaining. Has anybody experienced the same issue? Is some sort of cross-domain issue?
Older versions of mwEmbed had a bug with the iframe embed ( 1.7.1.11 ) .
Please try upgrading to the latest stable release ( 1.8.7 ). Here is a sample test page working in firefox with that version.
Note the test page is doing something a lite different ( invocation via lightbox ), but the basic point is if you update that uiConf to 1.8.7 everything should work fine.

Change IFrame Source if page doen't load in IFrame using Javascript

I have a code like this:-
<html>
<head>
<title>Test Page</title>
</head>
<body>
ABC
<iframe name="iframe"></iframe>
</body>
</html>
I want this functionality:-
If there is an error in loading the page if IFrame, than it change the IFrame source to other url. I want this for both Firefox and IE using javascript

Error in loading youtube, stackoverflow or facebook main pages into iframe tag

When i try to use the following code to load facebook or you youtube into iframe tags nothing is happened. page isn't loaded into iframe tag
this problem occurs with multiple sites such as youtube, stackoverflow and facebook
code:
<head>
<title>HTML Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Below is an iframe.</p>
<iframe src="http://www.youtube.com/" width="400" height="150">
<p>iframes are not supported by your browser.</p>
</iframe>
</body>
</html>
any help please
I tried it
http://jsfiddle.net/KPk6n/1
And looking at the console, I get
Display forbidden by X-Frame-Options
So I think those sites disallow framing, there probably is a workaround to this, but I'd say you should respect them and not frame them
The sites you speak of probably disable access from iFrames.
My site works just fine in this example: http://jsfiddle.net/3vxvm/

Categories