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.

peterd (6) [Avatar] Offline
#1
Can you specify a script src AND put code between opening/closing tags?

-peter


<script src="http://platform.linkedin.com/in.js">
api_key: YOUR_API_KEY
</script>


I did a quick test w/ alert() and specifying a script src, but never saw the alert() display.
benvinegar (68) [Avatar] Offline
#2
Re: Listing 1.3
No, you can't - the body of the script is ignored. But it remains in the DOM.

What the LinkedIn JS API does, once it's loaded, is scan the DOM for this script tag and read the JSON configuration from the script tag body (i.e. using innerText).

This is obviously really confusing. That's why we actually killed this example in favor of an entirely different one in the current version of the text (which I'm guessing you don't have ...) smilie