Hello,
Please help me. I'm running site made only in html and css and is hosted on Apache server. I cannot change anything, except adding programming code into html head and body.
How I could add Amazon store pages made in xml into my html pages...
Is there any solution for that ?
Thank you very much for help

Dani AI

Generated

As noted, you only can add code to the page, so the practical approaches are limited. As pointed out, client-side JavaScript can parse XML, but there are important constraints: the XML must be available to the browser (same origin or CORS enabled), and Amazon product APIs usually require signed requests and secret keys that must not live in client code.

If the XML feed is same-origin or CORS-enabled you can fetch it in the browser and turn it into DOM (DOMParser/responseXML) or apply an XSLT (XSLTProcessor) to produce HTML. Check the browser console for CORS failures and the response headers to confirm access. If the XML is on Amazon and requires authentication, a client-only solution is unsafe because it would expose credentials.

The simplest, safest fixes are: use Amazon Associates embeddable widgets/snippets (designed for pasting into static HTML), or add a tiny server-side proxy or serverless function to fetch/sign Amazon API calls and return JSON/HTML to the page. If you truly cannot change any server settings, test whether an iframe or object will work (many sites send X-Frame-Options so this may be blocked) or fall back to Amazon-provided embed code. For details on cross-origin and client-side XSLT, see the MDN docs on Cross-Origin Resource Sharing (CORS) and XSLTProcessor.

Recommended Answers

All 3 Replies

I was unaware of this and you give me a good explanation. Thanks twiss

Glad it helped!
Don't forget to flag the thread solved :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.