ใส่ flash ในเว็บให้ผ่าน validate html


วิธีการทำเว็บให้ถูกต้องโดยผ่านการ validate กับ w3c นั่นไม่ยากเลยครับ โดยที่พลาดกันบ่อยๆก็คงจะเป็นการเพิ่มหรือใส่ flash เข้าไปในเว็บเราเพื่อทำ banner หรืออะไรก็แล้วแต่ โดยถ้ายังใช้ embed tag ในการใส่ flash ลงไปในเว็บเรา พอเราไป validate กับ w3c ก็คงไม่ผ่าน

<embed
src="file-flash.swf"
width="300"
height="300"
allowscriptaccess="always"
allowfullscreen="true"
/>

และก็อาจเจอ error ดังรูป

error validate

และนี่คือ code ที่จะใส่ flash ในเว็บเราถูกต้องแล้วผ่านการ validate กับ w3c ครับ

<object
type="application/x-shockwave-flash"
data="ที่อยู่/file-flash.swf"
width="750" height="400">
<param name="movie"
value="ที่อยู่/file-flash.swf" />
</object>

เพียงแค่นี้เราก็เอาเว็บไป validate html ผ่านแล้ว...

via: http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-insert-flash-the-correct-way/


Comments

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • HTML tags will be transformed to conform to HTML standards.

More information about formatting options

CAPTCHA
คำถามนี้ทดสอบว่าคุณมีความรู้ทางคณิตศาสตร์ ไม่ได้โง่!!!
6 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.