HTML DOM enctype ÊôÐÔ
¶¨ÒåºÍÓ÷¨
enctype ÊôÐÔ¿ÉÉèÖûò·µ»ØÓÃÓÚ±àÂë±íµ¥ÄÚÈÝµÄ MIME ÀàÐÍ¡£
Èç¹û±íµ¥Ã»ÓÐ enctype ÊôÐÔ£¬ÄÇôµ±Ìá½»Îı¾Ê±µÄĬÈÏÖµÊÇ "application/x-www-form-urlencoded"¡£
µ± input type ÊÇ "file" ʱ£¬ÖµÊÇ "multipart/form-data"¡£
Óï·¨
formObject.encoding=encoding
ʵÀý
ÏÂÃæµÄÀý×Ó¿É·µ»Ø±íµ¥µÄ±àÂëÀàÐÍ£º
<html>
<head>
<script type="text/javascript">
function showEnctype()
{
var x=document.getElementById("myForm")
alert(x.enctype
)
}
</script>
</head>
<body>
<form id="myForm" enctype="application/x-www-form-urlencoded">
Name: <input type="text" value="Mickey Mouse" />
<input type="button" onclick="showEnctype()"
value="Show enctype" />
</form>
</body>
</html>