Mit new Image() erzeugst du ein neues Image Objekt.
Schau dir einmal http://de.selfhtml.org/javascript/beispiele/buttons.htm#quelltext an.
Da wirds z.B. verwendet.
Danke es klappt!
neue funktion:
if (picNum && pics[picNum])
{
// URL zum Bild
loadPic = picURL + pics[picNum];
var picture = new Image();
picture.src = loadPic;
picture.onload = function ()
{
if (picture.width <= '700')
{
alert(picture.width);
document.getElementById('player').innerHTML="<img src='"+loadPic+"'></embed>";
window.scrollTo(0,0);
}
else
{
alert(picture.width);
document.getElementById('player').innerHTML="<img src='"+loadPic+"' width='50%'></embed>";
window.scrollTo(0,0);
}
}
}