Hacker News new | ask | show | jobs
by ocdtrekkie 2556 days ago
I think you are misunderstanding my point.

An img tag doesn't work on an AMP page. It has to be an amp-img. Every standard HTML tag is invalid in AMP content, as you must use a customized AMP flavor of HTML.

Whether or not it returns valid as HTML markup isn't really relevant: The point is it's an entirely different, incompatible, markup, from what a normal browser knows how to interpret and use, and if your browser doesn't have JavaScript, it's not even going to know what any of those custom tags are, is it?

2 comments

That's not true, only tags that make web requests or do dynamic things are amp'd. You still use div and button and style and span and whatnot.
There is an important difference between saying it is invalid html, and it is invalid amp markup. An img tag will work like normal. It just won't be a valid AMP page any longer.

>if your browser doesn't have JavaScript, it's not even going to know what any of those custom tags are, is it?

It wouldn't. <noscript> tags are needed for that. But Javascript is a web standard, and this is the correct way to create new elements.