CodingHTML Help

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Peter (BOUGHTONP)  
 To:  Wattsy (SLAYERPUNX)      
32890.5 In reply to 32890.4 
Jon and Ben should both be hung, drawn & quartered for providing the code they did. It is BAD and WRONG. :@

Also, since the JS is 90% the same for all four clocks, you can encapsulate it in a function.

Here is better code:
code:
<script type="text/javascript" src="http://www.worldtimeserver.com/clocks/embed.js"></script>
<script type="text/javascript">
	function renderClock(color,location)
	{
		showClock
		({ wtsclock: 'wtsclock001.swf'
		, color: color
		, wtsid: location
		, width: 100
		, height: 100
		, wmode: 'transparent'
		});
	}
</script>
<style type="text/css">
	.clock {float: left; clear: none; margin: 0 1em;}
	.break {float: none; clear: both;}
</style>


<div class="clock"><script type="text/javascript">renderClock('FF9900','GB');</script>     <h2>London</h2>   </div>
<div class="clock"><script type="text/javascript">renderClock('FF0000','US-MA');</script>  <h2>Boston</h2>   </div>
<div class="clock"><script type="text/javascript">renderClock('228B22','US-FL');</script>  <h2>St Pete</h2>  </div>
<div class="clock"><script type="text/javascript">renderClock('0000FF','AU-VIC');</script> <h2>Melbourne</h2></div>
<br class="break"/>


Ideally, the first block (style and script stuff) should go inside your <head>..</head> tags, but it'll work outside it too.

(The code could/should be encapsulated even further, but it's good enough for now; the main thing is to get away from the incorrect use of tables.)
0/0
 Reply   Quote More 

 From:  Wattsy (SLAYERPUNX)   
 To:  Peter (BOUGHTONP)     
32890.6 In reply to 32890.5 
Thanks Peter. I do love teh savage attack on your fellow forumites!

Web Shite Mail Me

0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  Peter (BOUGHTONP)     
32890.7 In reply to 32890.5 
Jon and Ben both provided code in the style it was already in, knowing full well that it is 'depreciated' and not the way w3c wants it but not giving a crap cos it works - :P

Jon
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Wattsy (SLAYERPUNX)      
32890.8 In reply to 32890.6 
Pah, that was subdued compared to what they deserve. The duty of tables has been despoiled for far too long, and it's time to make a stand against these evil-doers. :@
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  JonCooper     
32890.9 In reply to 32890.7 
Screw the w3c, it's got bugger all to do with what they want. (And it's probably their fault this whole mess exists in the first place.)

You need to ask yourself "if I did this with Office, would I use Excel" - if the answer is no, you don't use tables.
If the answer is yes, then you might use tables, or you might use lists.

It's not about what appears to work - it's about using the correct tool for the job. You can use a knife for a screwdriver, but if you've got a rack full of assorted screwdrivers you pick the appropriate one and use that. </poor analogy>


I'm not going to go on and on about this (any more than I already have done :P) but misusing tags is a serious issue - the sooner it becomes history the sooner the web can move onto getting cool features, and the better search results will be.
(And if people recommend bad code, I will jump on them. :{))
0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  Peter (BOUGHTONP)     
32890.10 In reply to 32890.9 
while I appreciate all you're saying, and even agree with most of it, I stick by my reasoning that the request was to change the code so the clocks went horizontally rather than vertically, not to rewrite the whole shebang 'properly'

:P again

Jon
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  JonCooper     
32890.11 In reply to 32890.10 
The OP also said they want to get their finger out and learn more, and attacking the tables was a good way to teach.

:P :P
0/0
 Reply   Quote More 

 From:  Ben (BENLUMLEY)  
 To:  Peter (BOUGHTONP)     
32890.12 In reply to 32890.5 

fuck off, you patronising twat.

 

i was at work, so speed was most important. So i copied/pasted the tables around.

0/0
 Reply   Quote More 

 From:  Ben (BENLUMLEY)  
 To:  Peter (BOUGHTONP)     
32890.13 In reply to 32890.8 
and again
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Ben (BENLUMLEY)     
32890.14 In reply to 32890.12 
f932kj9ji3f
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Ben (BENLUMLEY)     
32890.15 In reply to 32890.12 
(Sorry I was at work so I had to quickly write unhelpful nonsense instead of a proper post.)
0/0
 Reply   Quote More 

 From:  Rowan  
 To:  Ben (BENLUMLEY)     
32890.16 In reply to 32890.12 
Having a bad day?
0/0
 Reply   Quote More 

 From:  Ben (BENLUMLEY)  
 To:  Rowan     
32890.17 In reply to 32890.16 

a little busy yes.

 

but his comments would irritate me any day

0/0
 Reply   Quote More 

 From:  Rowan  
 To:  Ben (BENLUMLEY)     
32890.18 In reply to 32890.17 
Then you need to drink less caffeine.
0/0
 Reply   Quote More 

Reply to All    
 

1–18

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats