The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

KevinH (2) [Avatar] Offline
#1
Hi Authors

A great book full of real world examples of using 3rd party js. However, having had a few quick read throughs, I am not seeing a clear solution to my problem, which I think will be a recognisable use case:
I want a merchant to be able to insert a dom element. I want to use that placeholder to inject/decorate with additional functionality from my remote server. I cannot use sub domains to circumvent the same origin policy as this is intended to be used by many merchants. What is the recommended solution?

In my specific instance, I want to be able to use the dom element to pick up parameters (OrderID) and then manipulate the dom to insert a link that when clicked creates a modal window and fires an ajax request to return content from my server.

Of course, I would not expect a full blown solution, but I cannot see which approach is the best way to resolve this problem (decorate a dom element and retrieve content from a remote server. Security being key)


The book provides several solution, but I cannot see one that is the 'definitive' approach? For instance the chapter on easyXDM is a great introduction, but is this the solution?

I do understand that you cannot cover all situations, but I think it would be good to provide a list of common problems that 3rd party js can solve and a recommended approach? Alternatively a list of real world implementations and why they chose these solutions.

Overall - a really useful read which has increased my knowledge of the problems of developing third party js.

Good look with the book.

Kind Regards

Kevin
benvinegar (68) [Avatar] Offline
#2
Re: Recommended Approach
Hey Kevin,

Thanks for the feedback. Glad the book wasn't terrible smilie

I'd be glad to give you some advice, but I'm not sure I completely follow what you're doing. Is this a widget? Is there a version on the web I can see somewhere?

- Ben