txt>html
Started by
craiggster123321
, Jun 07 2005 03:14 PM
#1
Posted 07 June 2005 - 03:14 PM
#2
Posted 08 June 2005 - 07:14 AM
Try saving as "file.html" with the double quotes?
#3
Posted 08 June 2005 - 03:36 PM
Easy to solve: take a working html document, copy it, delete the copy's contents, add the content from the .txt file into the copy, rename the copy and wala!
Let me know if you need help, its quite simple but I can do it for you if there are any problems.
ditto's right too, just giving you another option
Let me know if you need help, its quite simple but I can do it for you if there are any problems.
ditto's right too, just giving you another option
Edited by ssone, 08 June 2005 - 03:39 PM.
#4
Posted 11 June 2005 - 04:32 AM
thanx ,it was because i had installed firefox and uninstalled it but ive got it back now so the files just open in the firefox browser
#5
Posted 13 June 2005 - 12:24 PM
can some1 plz tell me whats wrong with this script
its just to display a simple clock on my web page:
<html>
<head>
</head>
<body>
<script language="javascript">
function clock()
{
var date=newDate();
var hour=date.getHours();
var min=date.getMinutes();
var sec=date.getSeconds();
if(hour<=9)
hour="0"+hour
}
if(min<=9)
{
min="0"+min
}
if(sec<=9)
{
sec="0"+sec
}
docuent.form.input.value=+hour+":"+min+":"+sec+
}
</script>
<form name="form">
<input name="input" type="text">
</form>
</body>
</html>
?
its just to display a simple clock on my web page:
<html>
<head>
</head>
<body>
<script language="javascript">
function clock()
{
var date=newDate();
var hour=date.getHours();
var min=date.getMinutes();
var sec=date.getSeconds();
if(hour<=9)
hour="0"+hour
}
if(min<=9)
{
min="0"+min
}
if(sec<=9)
{
sec="0"+sec
}
docuent.form.input.value=+hour+":"+min+":"+sec+
}
</script>
<form name="form">
<input name="input" type="text">
</form>
</body>
</html>
?
#6
Posted 13 June 2005 - 12:36 PM
i believe u are missing a "{"
that was a really quick look
f(hour<=9){ hour="0"+hour }
that was a really quick look
#7
Posted 13 June 2005 - 12:37 PM
yeh i saw that 1 but its still not working
#8
Posted 13 June 2005 - 12:39 PM
well you arent calling the function anyway in the html?
#9
Posted 13 June 2005 - 12:41 PM
ive called it in the body onload but its still not working
heres the new script:-
<html>
<head>
</head>
<body onload="clock()">
<script language="javascript">
function clock()
{
var date=newDate();
var hour=date.getHours();
var min=date.getMinutes();
var sec=date.getSeconds();
if(hour<=9)
{
hour="0"+hour
}
if(min<=9)
{
min="0"+min
}
if(sec<=9)
{
sec="0"+sec
}
docuent.form.input.value=+hour+":"+min+":"+sec+
}
</script>
<form name="form">
<input name="input" type="text">
</form>
</body>
</html>
heres the new script:-
<html>
<head>
</head>
<body onload="clock()">
<script language="javascript">
function clock()
{
var date=newDate();
var hour=date.getHours();
var min=date.getMinutes();
var sec=date.getSeconds();
if(hour<=9)
{
hour="0"+hour
}
if(min<=9)
{
min="0"+min
}
if(sec<=9)
{
sec="0"+sec
}
docuent.form.input.value=+hour+":"+min+":"+sec+
}
</script>
<form name="form">
<input name="input" type="text">
</form>
</body>
</html>
#10
Posted 13 June 2005 - 01:04 PM
does any1 no what im doing wrong???
#11
Posted 13 June 2005 - 01:45 PM
i actually dont know js syntax.... ill check it out though
#12
Posted 13 June 2005 - 02:35 PM
You made a typo and put 'docuent' instead of 'document'. Not sure if that's it's problem but it might be one of them.
Edited by Thing'e', 13 June 2005 - 02:38 PM.
#13
Posted 13 June 2005 - 03:57 PM
fisrt if all, you have two "body"s, put the script should be in the head and the body should be after the script, second, the script is messed, do you want a whole new one? (Ill give you a bunch of different clocks to choose from)
#14
Posted 13 June 2005 - 06:56 PM
you might want to get in the habit of terminating lines with ';'. most browsers are user friendly, however, and allow sloppy code.
here's a modified version of clock(), changes in red:
function clock()
{
var date=new Date();
var hour=date.getHours();
var min=date.getMinutes();
var sec=date.getSeconds();
if(hour<=9)
{
hour="0"+hour;
}
if(min<=9)
{
min="0"+min;
}
if(sec<=9)
{
sec="0"+sec;
}
document.form.input.value=+hour+":"+min+":"+sec;
setTimeout("clock()",1000);
}
here's a modified version of clock(), changes in red:
function clock()
{
var date=new Date();
var hour=date.getHours();
var min=date.getMinutes();
var sec=date.getSeconds();
if(hour<=9)
{
hour="0"+hour;
}
if(min<=9)
{
min="0"+min;
}
if(sec<=9)
{
sec="0"+sec;
}
document.form.input.value=+hour+":"+min+":"+sec;
setTimeout("clock()",1000);
}
#15
Posted 14 June 2005 - 09:06 AM
thanx a lot, its working now
Similar Topics
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users