views:

423

answers:

1

There is a similar question here: http://stackoverflow.com/questions/525992/resize-iframe-height-according-to-content-height-in-it. But it is not about Amazon aStore.

When you create an Amazon aStore, you get a code like:

< iframe src="http://astore.amazon.com/AMAZON_SOME_STORE_HERE-20" width="90%" height="4000" frameborder="0" scrolling="no">

The problem is the static height "4000". What should I add to the code to get it dynamically adjusted to the height of the aStore?

A: 

I don't believe you'll be able to do it keeping that <IFRAME>, because to get the height of the store, you would need to run some piece of JavaScript on the store page.

The problem is most browsers don't allow you to run your own JS code on other domains because of possible Cross-site scripting attacks.

Maybe you could try to fetch that page using AJAX and inserting the contents into a <DIV> on your page. By doing this, bear in mind that if the user clicks on any link inside the store they'll browse away from your page, instead of the "normal" workflow in which the user clicks inside the iframe, it gets reloaded and your page sits quiet around it.

Seb