Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

txt>html


  • Please log in to reply

#1
craiggster123321

craiggster123321

    Member

  • Member
  • PipPip
  • 36 posts
can someone help , everytime i change a txt file into a html file my computer doesn't recognise the file type ??
  • 0

Advertisements


#2
ditto

ditto

    - i pwn n00bs -

  • Member
  • PipPipPipPip
  • 1,260 posts
Try saving as "file.html" with the double quotes?
  • 0

#3
ssone

ssone

    Member

  • Member
  • PipPipPip
  • 301 posts
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. :tazz:

ditto's right too, just giving you another option ;)

Edited by ssone, 08 June 2005 - 03:39 PM.

  • 0

#4
craiggster123321

craiggster123321

    Member

  • Topic Starter
  • Member
  • PipPip
  • 36 posts
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
  • 0

#5
craiggster123321

craiggster123321

    Member

  • Topic Starter
  • Member
  • PipPip
  • 36 posts
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>

?
  • 0

#6
ditto

ditto

    - i pwn n00bs -

  • Member
  • PipPipPipPip
  • 1,260 posts
i believe u are missing a "{"

f(hour<=9){
hour="0"+hour
}

that was a really quick look
  • 0

#7
craiggster123321

craiggster123321

    Member

  • Topic Starter
  • Member
  • PipPip
  • 36 posts
yeh i saw that 1 but its still not working
  • 0

#8
ditto

ditto

    - i pwn n00bs -

  • Member
  • PipPipPipPip
  • 1,260 posts
well you arent calling the function anyway in the html?
  • 0

#9
craiggster123321

craiggster123321

    Member

  • Topic Starter
  • Member
  • PipPip
  • 36 posts
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>
  • 0

#10
craiggster123321

craiggster123321

    Member

  • Topic Starter
  • Member
  • PipPip
  • 36 posts
does any1 no what im doing wrong???
  • 0

Advertisements


#11
ditto

ditto

    - i pwn n00bs -

  • Member
  • PipPipPipPip
  • 1,260 posts
i actually dont know js syntax.... ill check it out though
  • 0

#12
Thing'e'

Thing'e'

    Member

  • Member
  • PipPip
  • 27 posts
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.

  • 0

#13
ssone

ssone

    Member

  • Member
  • PipPipPip
  • 301 posts
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)

:tazz:
  • 0

#14
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 875 posts
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);
}
  • 0

#15
craiggster123321

craiggster123321

    Member

  • Topic Starter
  • Member
  • PipPip
  • 36 posts
thanx a lot, its working now
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP