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. (29) [Avatar] Offline
1st remark :
The sample you give does not work if the script element is put inside the <head> element.

2nd remark :
the sample code :
<<var appendTo = document.getElementById('stork-widget'); >
appendTo.parentNode.insertBefore(div, appendTo);>>

looks weird to me and is not coherent with the sample given in 2.2.1 :
<<But you can always ask publishers to >
identify the target render location separately using a uniquely identified element:
<div id="camerastork-widget"/>

Hello, world

<script >
In this example, when widget.js loads, it will render the product widget and
append it to the < element div> with id="camerastork-widget".>>

3rd remark :
Listing 3.1 is not coherent with Listing 2.1 on the value for script.src (script.src should always be cross domain ?)

Best regards
Henri d'Orgeval
benvinegar (68) [Avatar] Offline
Re: 3.1.2 Appending to a known location
Another late reply.

I only noticed now that the script URLs somehow became relative instead of absolute. No idea how this happened – huge oversight. I've remedied it in the current draft.