se ho capito bene prova così:

file scripts.htm:

<script src="script.js">
</script>
[img]test.jpg[/img]
dentro script.js ci metti solo il contenuto dello script Javascript:

var MAX_WIDTH = 300 , MAX_HEIGHT = 300;

function resizeImage( ptrImage )
{
ptrImage.title = "Dimensioni originali: " + ptrImage.width + "x" + ptrImage.height;

while( ptrImage.width > MAX_WIDTH || ptrImage.height > MAX_HEIGHT ) {
ptrImage.width -= 10;
}

ptrImage.style.visibility = "visible";
}
poi in un file (ad esempio notizie.php) metti:

Codice PHP:
require("scripts.htm"); //include il JS (ossia il codice html che contiene il JS ) 
Spero che intendevi questo (non è chiara la tua domanda)

Ciao