Forum Moderators: phranque
Even something as simple as this:
<a href="somelink.html" onClick="alert('boo');">BOO</a>
Can be external.
... <head>
<script type="text/javascript" src="external.js"></script>
</head>
<body>
<a id="mylink" href="somelink.html">BOO</a>
"external.js"
function attachBehaviors() {
if (document.getElementById('mylink') {
document.getElementById('mylink') onClick=function() { alert('boo'); }
}
}
window.onload=function () { attachBehaviors(); }
A PHP include is not "external" when it gets to the browser, the code has already been included in output. However, includes have a very useful function - that of compartmentalizing specific functions so it's easier to find and kill a bug. This is a different "kind" of external.
I code Green Acres... ie, dirt simple, so do not have many issues regarding code bloat.
>> Go external with scripting languages if you must have them - there is little reason to have them that I can see - they rarely will help a site and stand to hurt it greatly.
Does it primarily mean with javascript ?
i doubt includes woudl have much difference in php ?
im not to sure about asp.