AMP images in readers - html

I have a website with AMP pages that allow editors to add images to the page. The images are displayed using an amp-img element and render in any normal browser.
When either user a reader view or being crawled by a site such as Embedly the amp-img elements are not displayed.
I assume this is caused by the amp-img element not being a valid HTML element so is ignored. Is there anyway to get around this issue?

You can add a noscript element for renderers not using javascript:
<amp-img src="welcome.jpg" alt="Welcome" height="400" width="800">
<noscript>
<img src="welcome.jpg" alt="Welcome" height="400" width="800" />
</noscript>
</amp-img>

I had left out the head tag of <script async src="https://cdn.ampproject.org/v0.js"></script> as listed in the documentation. Including that fixed it.

Related

What is the purpose of html that goes within iframe tags?

I read once somewhere that it was fallback content but it does not display when src fails to load.
<html>
<head>
</head>
<body >
<iframe src="https://www.google.com/">
<p>text</p>
</iframe>
</body>
</html>
In the current specification the content model of an iframe is defined as "Nothing" so it is an error.
The previous specification (from the '90s) said:
The contents of the IFRAME element, on the other hand, should only be displayed by user agents that do not support frames or are configured not to display frames.
So it was a fallback, but for browsers that don't support the element, not for when the URL fails to load.

iframe url content should aplly css styles using jquery

I need to change the iframe url css styles
<iframe id="anil" width="400" height="480" src="https://getbootstrap.com/docs/3.3/examples/starter-template/"></iframe>
Tried it using jquery but couldn't solve it
$("iframe").contents().find("body").css("background-color","yellow");
You can not access by javascript the content of an iframe for security reasons.

How to include a web site in a jsp

I need to include a web page in my jsp file. i.e: https://www.google.com
I tried both <s:include> and <include>, but it didn't work.
Please give me an example for that. Project is use Struts2 Framework.
You need to use an <iframe>.
The <iframe> element represents a nested browsing context.
For example:
<body>
<span>The following is an i-framed content:</span>
<iframe src="https://www.google.com" width="600" height="600">
</iframe>
</body>

Embed html5 banner inside another html page

I have a html5 banner that I've been supplied with that has some animations and so on. How would I embed this inside an already existing html document? I don't want to grab the code from the html5 document, instead it would be nice if I could link to the html5 banner..
I don't know if this is possible though.
<html>
<body>
<!-- Embed html5 banner here -->
<div src="/assets/html5banner.html" /> <!-- Something like that, I don't know -->
</body>
</html>
Any push in the right direction would really be appreciated! Thanks
Use iframe to embed other html document into your page
<iframe src="#"></iframe>
iFrames are your friends.
<iframe src="/htmlanim.html"></iframe>
You can also be fancy-shmancy and use Ajax to append the content dynamically to an empty <div>-Container.
You should just use an iframe.

line after IFRAME is not visible

line after IFRAME is not visible in both IE and FF. refer the below code and let me know whether I am doing anything wrong.
<html>
<body>
line before iframe <br />
<iframe src="about:blank" />
<br /> line after iframe
</body>
</html>
you need to close the iframe tag. otherwise the content that comes after it is considered "things to show" when iframe is not supported.
(by the way, i think if you use XHTML to write the <iframe ... /> then IE will take it as HTML instead. IE doesn't understand XHTML as XHTML. It understands it as HTML.)
create the iframe with a separate close tag:
<html>
<body>
line before iframe <br />
<iframe src="about:blank"></iframe>
<br /> line after iframe
</body>
</html>
There are some tags (iframe and textarea come to mind) which don't like it when you use their compact form.
I was integrating Facebook Connect in my webpage via iFrame tag, like this:
<iframe src="..." style="..."></iframe>
It worked in all browsers except IE8.
Now I found out, that YOU HAVE to provide a text as content of the tags. Then it works perfectly!
Example:
<iframe src="..." style="...">Your browser does not support iFrames</iframe>
or what I am using now is the following (display just a space):
Solution:
<iframe src="..." style="..."> </iframe>