A page can load javascript from anywhere.
When users can edit website content, use PHP's:
window.open("http://example.com", "new window", options)
Document Object Model - object-oriented representation of a web page
An object is created for every element (tag) on the page
<a href="http://example.com" id="mylink1">link</a>
generates an HTMLAnchorElement object, which contains its attributes (such as href), its style information, its children and parent pointers, etc
function $(name) { return document.getElementById(name) }