question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

amp-bind doesn't change img src

See original GitHub issue

Issue first seen here https://github.com/ampproject/amp-by-example/issues/586

It appears that changing the src of an amp-img does not update the src of the img.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dreamofabearcommented, Feb 3, 2017

Most likely due to stale AMP runtime in SW cache. E.g. My cached version was 1482359659944 which lacked the mutatedAttributesCallback method. Can’t repro after clearing cache.

Please reopen if still reproducible after clearing cache.

/cc @sebastianbenz Perhaps amp-by-example should change caching strategy from cacheFirst to fastest to avoid these types of problems for new/experimental components?

0reactions
dreamofabearcommented, Feb 10, 2017

Verified fixed in new canary 1486754279878.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change amp-img src? - javascript - Stack Overflow
I want to change the img src through JavaScript and it does not seem to work. HTML: <amp-img id="logo-cat" src="http/images.." ...
Read more >
amp-img not rendering a new image as src attribute changes ...
This problem is only reproducible from AMPs that are served from google cache. when amp-img src attribute bound to amp-state changes, the new ......
Read more >
Example: <amp-img> - amp.dev
You can use amp-bind to dynamically change the src URL of an amp-img . Remember to also change the alt if the content/meaning...
Read more >
4 tricks for developing with the AMP framework
The first thing we will have to do is include the amp-bind component within ... Next, we will modify our button so that...
Read more >
How to create an image element dynamically using JavaScript
Given an HTML element and the task is to create an <img> element and ... How to change/update image size dynamically using amp-bind...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found