For once, I need some html help
16-12-2010, 18:34
|
#1
|
|
cf.geek
Join Date: Jan 2008
Posts: 760
|
For once, I need some html help
Working on a simple ajax powered captcha. Heres what I have so far, its non functional yet...
http://milambar.masterroot.de/circle2.html
Now.. If I add a doctype (of any kind), I get this:
http://milambar.masterroot.de/circle.html
Without a doctype, the html works as intended.
With a doctype, the html is treated as if it was a .txt file. I can't for the life of me figure out why...
__________________
Algebra is great.
For a food-dish, of radius Z, and thickness A, you can say it is PI*Z*Z*A
|
|
|
16-12-2010, 19:59
|
#2
|
|
vrooooom!
Join Date: Nov 2005
Location: Going sideways :)
Services: V+ | o2 BB
Posts: 522
|
Re: For once, I need some html help
what character encoding are you declaring in the doctype? I'm on my phone so can't view source
Edit:
Try adding:
Code:
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
as W3 Validator is chucking out a character encoding error.
Last edited by mr_bo; 16-12-2010 at 20:50.
|
|
|
16-12-2010, 20:36
|
#3
|
|
cf.geek
Join Date: Apr 2004
Location: Warrington
Services: | Freeview | VirginTV XL with TiVo | BB L | Phone M |
Posts: 524
|
Re: For once, I need some html help
I have just had a look at this, and one thing is in your style tag you have .letterBox (with capital B), but in the spans the class is letterbox (with lower case b).
XHTML is case sensitive, so classes have to be spelt the same way.
Saying that, when I replace .letterBox with .letterbox all the spans ended up on top of each other.
|
|
|
16-12-2010, 20:58
|
#4
|
|
cf.geek
Join Date: Jan 2008
Posts: 760
|
Re: For once, I need some html help
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
circle.html validates perfectly at the w3c validation tool, but doesn't work in reality.
circle2.html doesnt validate (because I deleted the doctype line), but work perfectly in reality.
I can't figure out why the doctype declaration is ruining the html itself.
In response to mentalis: Yes, I spotted that a bit ago, and corrected it, just forgot to upload the changed files. I've uploaded them now, as you can see, different error, but still broken.
__________________
Algebra is great.
For a food-dish, of radius Z, and thickness A, you can say it is PI*Z*Z*A
Last edited by Milambar; 16-12-2010 at 21:01.
|
|
|
16-12-2010, 22:16
|
#5
|
|
Gone
Join Date: Jun 2003
Age: 31
Posts: 14,760
|
Re: For once, I need some html help
Change the last two lines to this:
Code:
boxArray[i].style.top = Math.floor(y) + 'px';
boxArray[i].style.left = Math.floor(x) + 'px';
It's a javascript error as you are trying to parse in doubles when the style needs an int converted to a string with units.
I have no idea why you get it with the doctype and not without. Must be something to do with the Javascript engines.
Also there's an error in the CSS. There's no such thing as #black;, it is #000000;
---------- Post added at 22:16 ---------- Previous post was at 21:36 ----------
BTW, i've done a quick google. Seems a common problem. When you specify a doctype you shift your browser from "quirks mode" (where the browser tries to fix errors) into standards mode (where it skips errors).
|
|
|
16-12-2010, 23:11
|
#6
|
|
cf.geek
Join Date: Jan 2008
Posts: 760
|
Re: For once, I need some html help
Thank you so much, Punky. Gods, how did I miss that...
__________________
Algebra is great.
For a food-dish, of radius Z, and thickness A, you can say it is PI*Z*Z*A
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 12:37.
|