js vs css in html5
6 replies [Last post]
daku kecewa tak boleh nak pos apa2 lagi ...
amin007's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Pro
Joined: 08/16/2009
Points: 2050

cuba lihat kod di bawah ni

<link rel="stylesheet" type="text/css" href="../../../js/datepicker/datepicker.css">
<script type="text/javascript" src="../../../js/datepicker/datepicker-ymd.js"></script>

kalau nak import masuk *.css dari luar, kodnya senang sangat dalam satu tag sahaja

<link rel="stylesheet" type="text/css" href="../../../js/datepicker/datepicker.css">

tapi kalau nak import masuk *.js kena ada 2 tag

<script type="text/javascript" src="../../../js/datepicker/datepicker-ymd.js">
</script>

tak pasti dalam html5 bentuk js dan css macam mana. dengar ada tag baru
tapi lebih berharap kalau nak import js lagi luar hanya satu tag sahaja

pandangan anda semua

mweldan.com
weldan's picture
User offline. Last seen 41 weeks 1 day ago. Offline
Pro
Joined: 08/16/2009
Points: 297
daku kecewa tak boleh nak pos apa2 lagi ...
amin007's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Pro
Joined: 08/16/2009
Points: 2050

The Tag. Not Supported in HTML 5.
Definition and Usage

The tag is not supported in HTML 5. Use the tag instead.
The tag was used to define an embedded applet.

sedihnya java tak boleh guna lepas ni huhuhu

daku kecewa tak boleh nak pos apa2 lagi ...
amin007's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Pro
Joined: 08/16/2009
Points: 2050

petikan dari http://www.w3schools.com/html5/tag_script.asp

Quote:

Definition and Usage

The <script> tag is used to define a client-side script, such as a JavaScript.

The script element either contains scripting statements or it points to an external script file through the src attribute.

The required type attribute specifies the MIME type of the script.

Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content.
Differences Between HTML 4.01 and HTML 5

The "async" attribute i new in HTML 5.

Some HTML 4.01 attributes are not supported in HTML 5.
Tips and Notes

Note: There are ways a script can be executed:

The async attribute is "true": The script will be executed asynchrously with the rest of the page, so the script will be executed while the page continues the parsing.

The async attribute is "false", but the defer attribute is "true": The script will be executed when the page is finished with the parsing.

Both the async attribute and the defer attribute is "false": The script will be executed immediately, and the page will wait for the script to finish before continuing the parsing.

Tip: If there is a src attribute, the <script> element must be empty.

<pre>
Attribute Value Description
async async Defines if the script should be executed asynchronously or not
type text/ecmascript
text/javascript
application/ecmascript
application/javascript
text/vbscript Indicates the MIME type of the script
charset charset Defines the character encoding used in script. Not supported.
defer defer Indicates that the script is not going to generate any document content. The browser can continue parsing and drawing the page
src URL Defines a URL to a file that contains the script (instead of inserting the script into your HTML document, you can refer to a file that contains the script)
</pre>

ooo, kalau macam ni, susah sikit laa, masih kena pakai 2 tag mmm

mweldan.com
weldan's picture
User offline. Last seen 41 weeks 1 day ago. Offline
Pro
Joined: 08/16/2009
Points: 297
daku kecewa tak boleh nak pos apa2 lagi ...
amin007's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Pro
Joined: 08/16/2009
Points: 2050

Event Attributes

onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload

ondrag??? ooo, lepas ini bolehlah aku buat drag & drop sistem pakai mouse aje. tapi dah ada orang buat ker hehehe???

daku kecewa tak boleh nak pos apa2 lagi ...
amin007's picture
User offline. Last seen 18 weeks 4 days ago. Offline
Pro
Joined: 08/16/2009
Points: 2050

http://www.java2s.com/Code/JavaScript/Event-onMethod/onDragExample.htm

<html>
<head>
<script language="JavaScript">
<!--
function function1() {
  msg = 'on' + event.type + ' event fired by ' + '"' + event.srcElement.id + '"';
  alert(msg+"\nPress Enter twice to close this window")
}
-->
</script>
</head>
<body bottommargin=150>
  <p>Source object:
<input id="sourceObject" size=50 value="The text to Drag" ondrag="function1()">
<br>
  </p>
  <p>Drop selected text into the following text field.</p>
  Target object:
<input id="targetObject" size=50 value="Drag destination element">
</body>
</html>