amp-html

.htaccess redirect /amp/ urls to nonamp version

僤鯓⒐⒋嵵緔 提交于 2019-12-14 03:28:53
问题 I need to recover AMP Urls after switching off Google AMP. Can you help me please for having 301 redirects on any AMP url back to NonAMP Version? Example: anydomain/hardware/heute-ist-putztag/amp back to anydomain/hardware/heute-ist-putztag 回答1: found a solution at myself RewriteRule ^(.*)\/amp$ $1 [R=301,L] 来源: https://stackoverflow.com/questions/44854689/htaccess-redirect-amp-urls-to-nonamp-version

Google AMP: Form submission failed:: Unexpected token < in JSON at position 1

只愿长相守 提交于 2019-12-13 07:30:12
问题 I have added a form using the amp-form component and it validates perfectly. However, when I submit the form I get the error: log.js:399 Uncaught SyntaxError: Form submission failed:: Unexpected token < in JSON at position 1 Any idea? 回答1: This isn't an AMP problem it's a syntax error as the message states. What does the JSON look like that is being sent/returned to/from the server. Are you sure you're sending/receiving what you think you're sending/receiving? The error message to me means

amp-list with flexible height to a max

。_饼干妹妹 提交于 2019-12-13 04:07:29
问题 I want to provide a list which will vary with the input of a text box. This list will provide the results for that search query. I am using amp-list for this. I want the list height to adjust to the number of results (flex-item should be fine here). But I want the list to have a max height of e.g. 500px and no more Is this possible? Thank you very much 回答1: Dynamic resizing is currently in the works: see this thread on GitHub - although not sure if this applies in your current situation. Are

How to load external header and footer HTML in AMP-HTML pages

落爺英雄遲暮 提交于 2019-12-13 03:47:21
问题 I am converting an existing HTML to AMP-HTML. In older HTML I am loading footer and header which are in separate HTML files which are loaded by using jquery as mentioned in the below code. $("#divHeader").load('../header.html'); $("#divFooter").load('../footer.html'); These HTML have only static data. Is there any way to add these HTML in AMP pages? I cannot use amp-iframe because amp-iframe cannot be within first 75% of the viewport and has to be 600px away from the top as mentioned in this

HTML text in [text] when using amp-state

点点圈 提交于 2019-12-13 03:25:02
问题 I have a simple JSON file: { "title": "Title here", "content": "<p>line 1<br/>line 2</p>" } That I reference using amp-state <amp-state id="remoteContent" src="//mysite.local/json/remoteContent.json"></amp-state> I am then binding the result of this into an HTML container. <div class="title" [text]="remoteContent.title"> </div> <div class="content" [text]="remoteContent.content"> </div> My issue is the content text comes out literately, and doesn't render the actual HTML. Is there an

Response must contain the AMP-Access-Control-Allow-Source-Origin header (I have it)

南笙酒味 提交于 2019-12-13 03:18:45
问题 EDIT: I changed my form to submit to a new file called amp-form-submit.php That file looks like: <?php header("Access-Control-Allow-Credentials: true"); header("Access-Control-Allow-Origin:".$_SERVER['HTTP_ORIGIN']); header("AMP-Access-Control-Allow-Source-Origin: https://".$_SERVER['HTTP_HOST']); header("Access-Control-Expose-Headers: AMP-Access-Control-Allow-Source-Origin"); header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-Allow-Source-Origin"); if(!empty($_POST[

AMP-Access-Control-Allow-Source-Origin is not equal to the current

夙愿已清 提交于 2019-12-13 03:01:00
问题 Alrighty, I've been beating my head against this one for a few days and after extensive Googling (there's a lot of purple links when I search anything regarding this now) I'm pretty much stumped. The form works both from our domain and the AMP one, so maybe I should just get over it and let it be. At the same time though, I want it to be correct so hopefully someone can help me out here. I have read the AMP CORS documentation a few times and everything seems all good to me. On form submission

Can I 'enable' js if I embed the 'real' page inside an amp-iframe?

跟風遠走 提交于 2019-12-13 01:50:23
问题 I'm trying to enable AMP (Accelerated Mobile Pages) on a JavaScript dependent page but AMP disallows js. Has anyone had any luck embedding pages with js in amp-iframes? And is this hacky enough that it might have negative SEO implications, perhaps, I'm afraid, quietly in the future? Or is it a super clever (and safe) thing that nobody does for some weird reason? I suspect it is a futile exercise but for the sake of the SEO I am tempted. What I've learnt so far is that the amp-iframe source

Does it make sense to AMP enable a desktop site?

感情迁移 提交于 2019-12-13 00:24:18
问题 I have a rails site, Sensr.net, that adaptively renders on mobile. I'm thinking of AMP enabling the site. We render a mobile version and so AMP makes sense there, but does it make sense for the desktop version of a site? 回答1: If you're already running two versions and it works for you, you're probably better off creating an AMP version for mobile only. If you're look to consolidate to one version for easier maintaining purposes, by all means use AMP to create a responsive site that renders on

AMP Html <a target=“_blank”> not working on iphone safari browser to go new window

会有一股神秘感。 提交于 2019-12-12 20:02:30
问题 Recently I am developing a progressive web app with Accelerated Mobile Pages (AMP). I have to add anchor link with target="_blank" so that a user click on that link will be redirected to a new window with anchor location. <a href="External_Url" rel="external" target="_blank">Click</a> It's working fine on Android browser but target="_blank" is totally not working on the iOS Safari browser. I know this can be solved with Javascript but here at AMP we can not use any Javascript due to