|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (9 bit)
Join Date: Jan 2004
Location: Singapore
Posts: 448
|
Embedding java into HTML
Got this java script from a website.
*oh no.. can't get this java script to be show.. cos of the tag script* - start with script language = "JavaScript" end with /script - I wanna save them into a .js file and then call it from a HTML page. (Just using a css stylesheet) I am using Macomedia Dreamweaver MX 2004. What tag should i add into the HTML page? And do i just paste all these source into a .js file and save it without adding any other tags? Last edited by human1987; 09-18-2004 at 04:58 AM. |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
Put the JavaScript source in a text file, name it something like file.js.
In your HTML file, add the following to the head section: PHP Code:
|
|
|
|
|
|
#3 |
|
Member (9 bit)
Join Date: Jan 2004
Location: Singapore
Posts: 448
|
PHP Code:
omg.. cannot work now, even when just adding this lines into the head section! Last edited by human1987; 09-18-2004 at 10:34 PM. |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
You need to call that function somewhere in the page, for a clock I guess the best place is <body onload="clock();">.
A word of advice though, changing the statusbar text is annoying, it's one of the JavaScript features I disable in Firefox. |
|
|
|
|
|
#5 |
|
Member (9 bit)
Join Date: Jan 2004
Location: Singapore
Posts: 448
|
But this is meant to be shown in the status bar?
//display date and time window.status= gmon + " " + day +", " + year + " " + hour + ":" + mins +":" + secs +" " + ampm; |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
Yes, the clock appears in the status bar.
|
|
|
|
|
|
#7 |
|
Member (9 bit)
Join Date: Jan 2004
Location: Singapore
Posts: 448
|
However, i cannot embed it..
Might be changing it to other codes if it don't work... |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|