Home News Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | For once, I need some html help


You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion

For once, I need some html help
Reply
 
Thread Tools
Old 16-12-2010, 18:34   #1
Milambar
cf.geek
 
Join Date: Jan 2008
Posts: 760
Milambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud of
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
Milambar is online now   Reply With Quote
Advertisement
Old 16-12-2010, 19:59   #2
mr_bo
vrooooom!
 
mr_bo's Avatar
 
Join Date: Nov 2005
Location: Going sideways :)
Services: V+ | o2 BB
Posts: 522
mr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful onemr_bo is the helpful one
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.
mr_bo is offline   Reply With Quote
Old 16-12-2010, 20:36   #3
mentalis
cf.geek
 
mentalis's Avatar
 
Join Date: Apr 2004
Location: Warrington
Services: | Freeview | VirginTV XL with TiVo | BB L | Phone M |
Posts: 524
mentalis is just really nicementalis is just really nicementalis is just really nicementalis is just really nicementalis is just really nicementalis is just really nice
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.
__________________
Doctor Who In Detail :: http://www.mentalis.co.uk
mentalis is offline   Reply With Quote
Old 16-12-2010, 20:58   #4
Milambar
cf.geek
 
Join Date: Jan 2008
Posts: 760
Milambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud of
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.
Milambar is online now   Reply With Quote
Old 16-12-2010, 22:16   #5
punky
Gone
Alpha Bravo Charlie Champion
 
Join Date: Jun 2003
Age: 31
Posts: 14,760
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
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).
punky is offline   Reply With Quote
Old 16-12-2010, 23:11   #6
Milambar
cf.geek
 
Join Date: Jan 2008
Posts: 760
Milambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud ofMilambar has much to be proud of
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
Milambar is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Google Search




All times are GMT +1. The time now is 12:37.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Copyright © 2003 - 2012, Cable Forum.
(server1.cableforum.co.uk)

SEO by vBSEO 3.3.2