se ho capito bene prova così:
file scripts.htm:
dentro script.js ci metti solo il contenuto dello script Javascript:<script src="script.js">
</script>
[img]test.jpg[/img]
poi in un file (ad esempio notizie.php) metti: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";
}
Spero che intendevi questo (non è chiara la tua domanda)Codice PHP:
require("scripts.htm"); //include il JS (ossia il codice html che contiene il JS )
Ciao![]()
![]()