When I download my files from my website using FileZilla and put them into VSCode, VSCode changes all of my quotation marks and spaces in the iFrame srcdoc to their matching character entities.
Example:
Website Code:
<iframe scrolling="no" id="previewFrame" width="1000" frameborder="0" srcdoc="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional //EN&' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>"></iframe>
How it looks in VSCode:
<iframe scrolling="no" id="previewFrame" width="1000" frameborder="0" srcdoc="<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"></iframe>
Please tell me how to turn this off or if there is a setting I can change.
Related
I'm trying to add an Embed code in my Google Site
In the HTML, I'm trying to use <iframe> to display other sites in .aspx and .php.
<iframe> works totally fine with .aspx site. However, it does not display .php content.
To display .aspx, this is how my <iframe> part code looks like, which works fine.
<iframe
src="https://XXXX.aspx"
frameborder="0"
scrolling="no"
style="overflow:hidden;height:100%;width:100%"
height="100%"
width="100%">
</iframe>
However, when I added a .php site to iframe, it either shown nothing or returned 404 error.
The following was what I tried, and both of them did not work.
This returns a blank page
<iframe
src="https://www.php.net/manual/en/tutorial.firstpage.php"
frameborder="0"
scrolling="no"
style="overflow:hidden;height:100%;width:100%"
height="100%"
width="100%">
</iframe>
AND
This returns a 404 error
<iframe
src=<?php print "https://www.php.net/manual/en/tutorial.firstpage.php" ?>
frameborder="0"
scrolling="no"
style="overflow:hidden;height:100%;width:100%"
height="100%"
width="100%">
</iframe>
Please help!
This problem occurs when you enter wrong address in your Iframe tag.
please check that or tell us that address you want put in iframe.
You can test it out by putting
<!DOCTYPE html>
<html>
<body>
<iframe src="https://www.php.net/manual/en/tutorial.php">
</iframe>
</body>
</html>
into a new html doc and then open with a browser, you will see that
Refused to display 'https://www.php.net/manual/en/tutorial.php' in a
frame because it set 'X-Frame-Options' to 'sameorigin'.
in the broswer's console.
https://stackoverflow.com/a/27359031/8062552
i want to display the word document in my html page , i am using iframe , embed tags to displaying the
document, it works for pdf but not doc files, can any one please help me regarding this. it is possible or not?
<iframe src="wd-spectools-word-sample-04.doc" style="width:600px; height:500px;" frameborder="0">
</iframe>
<iframe style="width:600px; height:500px;" src="https://docs.google.com/gview?url=http://writing.engr.psu.edu/workbooks/formal_report_template.doc&embedded=true"></iframe>
I tried to include the youtube in an iframe but it appears blank. This is the code I'm checking with
<!DOCTYPE html>
<html>
<body>
<iframe src="http://www.youtube.com">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Why this is happening ? and what should I do to make it work ?
Check your console. It will most likely have a message like:
Refused to display 'https://www.youtube.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Read more about X-Frame-Options here:
The X-Frame-Options response header
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe> or <object>. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.
[...]
SAMEORIGIN
The page can only be displayed in a frame on the same origin as the page itself.
[...]
In other words [...] if you specify SAMEORIGIN, you can still use the page in a frame as long as the site including it in a frame is the same as the one serving the page.
Long story short: Youtube doesn't want you to embed their site (note: I'm talking about webpages here, not video's!) and explicitly set a HTTP header to communicate that to browsers.
If you want to display/embed a video use their code that is below every video under Share ยป Embed.
<iframe width="1280" height="720"
src="https://www.youtube.com/embed/dQw4w9WgXcQ?rel=0&showinfo=0"
frameborder="0" allowfullscreen>
</iframe>
you can try this one:
<!DOCTYPE html>
<html>
<body>
<iframe allowfullscreen="true" src="http://www.youtube.com/embed/c0MZ2bTtBm0?autoplay=1&autoplay=1" style="width: 100%; height: 100%; opacity: 1; display: block;" class="ms-slide-video"></iframe>
</body>
</html>
I have been trying to play a youtube video in a windows 8 html5 & javascript app with no luck!
I tried copy pasting the code youtube provided for embedding videos in the body of default.html, for example:
<iframe width="420" height="315" src="http://www.youtube.com/embed/k07IaB9yq_U" frameborder="0" allowfullscreen></iframe>
This gives the following error:
The Adobe Flash player or an HTML5 supported browser is required for video playback.
Get the latest flash player
Learn more about updating an HTML5 browser.
when I try using the video tag with the previous link, for example:
<video src="http://www.youtube.com/embed/k07IaB9yq_U" controls></video>
It says an invalid source!
What is the right way to do this?
Thanks
YouTube has a beta program to provide some videos in HTML5. You can join it here . Once you have done that you should be able to embed HTML5 YouTube videos in a WebView control by navigating to the YouTube URL.
Flash videos cannot be displayed in a Metro style app.
Code for the webview control
string htmlFragment =
#"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html>
<head>
<title>YouTubePagesample</title>
</head>
<iframe width='560' height='315' src='http://www.youtube.com/embed/{YoutubeID}' frameborder='0' allowfullscreen></iframe>
<body>
</body>
</html>;";
this.webView.NavigateToString(htmlFragment);
Use the setInnerHTMLUnsafe method as win 8 apps don't like the external JS being injected in the app. videoPlayer is the div which you want to add the embed to.
var content = '<iframe width="480" height="270" src="http://www.youtube.com/embed/8sPj0Ic8KQ8?rel=0" frameborder="0" allowfullscreen></iframe>' ;
WinJS.Utilities.setInnerHTMLUnsafe(videoPlayer, content);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head></head>
<body>
<embed width="420" height="345" src="video.wmv" type="application/x-shockwave-flash"></embed>
</body>
</html>
I am trying to embed a video in html page, video file is in local folder and that is of wmv format. Its not working. I have used the above mentioned code.
Convert video to SWF format by using any Converter. Then give link of that video. It'll work