JavaScript Image Object (可以從圖址取得圖片長寬等資訊)

JavaScript Image Object
The JavaScript Image Object is a property of the document object.

Properties
border - The width of the border around the image in pixels.
complete - A boolean value which identifies whether an image is completely loaded yet.
height - The read only height of the image in pixels.
hspace - The read only amount of horizontal space to the left and right sides of the image.
lowsrc - The read or write string giving the URL of an alternate image for low resolution screen display.
name - The assigned name of the image.
prototype - Used for adding user-specified properties to the image.
src - The URL of the image to be displayed. It is a read/write string.
vspace - The read only vertical space above and below the image.
width - The read only width of the image in pixels.
Events
onAbort
onError
onLoad


比如說

function getImgSize(imgSrc)
{
var newImg = new Image();
newImg.src = imgSrc;
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'*'+height);
}
</script>

onclick="getImgSize('images/testout_r1_c2.jpg')"

程式語言編年史

程式語言編年史原文 下面這張圖片描繪了整個程式語言的歷史。包括各種程式語言的發明人、程式語言的特點和適用領域、被什麼網站或公司使用等 (檢視 完整高清圖 )。 之所以會有那麼多不同的程式語言是因為設計程式語言的初衷不同、對語言學習曲線的追求不同、不同程式之間的執行成本差異...