• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Embedding Scripts

Browser software is dumb in the sense that it thinks everything is HTML. Feed it a Web page, and everything is fine. But feed it a text document or a JavaScript, and the browser tries to interpret it as HTML, and you get something like Figure 12.1. Instead of executing the embedded script, the browser treats it as HTML and displays the code on the page.

Figure 12.1. If you embed a script without enclosing it in script tags, the browser assumes it's HTML and displays it on the page.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint