Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 21-03-2008, 01:19 PM
Novice Webmaster
 
Join Date: Jul 2007
Location: Malaysia
Posts: 81
Rep Power: 0
kaisology is on a distinguished road
Where is the difference between ID and CLASS?

hm I remember there is a thread about ID n CLASS here somehow it is lost (n i too lazy to dig it out), so i make a new thread here ask the same question again

where is the difference between id n class? when to use id when to use class? i experimentally used them to hold several kind of properties n both of them works pretty well, cant see the different??

Last edited by kaisology : 21-03-2008 at 01:21 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 21-03-2008, 06:52 PM
yipguseng's Avatar
Lost Webmaster
 
Join Date: Jan 2007
Location: Petaling Jaya
Posts: 831
Rep Power: 36
yipguseng will become famous soon enough yipguseng will become famous soon enough
Send a message via MSN to yipguseng
a very simple explanation for understanding:
---
ID is a unique and therefore can only exist only 1 time in a single html file. all the attribute that's being declare in css for ID can only be use for a single element.

CLASS is the opposite of ID. All the attribute that's being declare in css for CLASS can be use multiple times on any html elements.
---

that's the definition, both actually does work well and see no difference as u said but if u check with the web standard checker, those html which has 2 same ID in a single html will return error. That's for web standard

and is better that u differentiate ID and CLASS properly as believe me, is very useful when u do some CSS modification in the future. "changing an ID attribute wont change anything else but changing CLASS attribute will affect others"

hope my explanation is clear
__________________
Boonage - Freedom is Everything
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 21-03-2008, 08:41 PM
Novice Webmaster
 
Join Date: Jul 2007
Location: Malaysia
Posts: 81
Rep Power: 0
kaisology is on a distinguished road
thanks yes clear enough!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 21-03-2008, 09:41 PM
mysticmind's Avatar
Super Moderator
 
Join Date: Jun 2001
Location: Mystic Kingdoms
Posts: 2,486
Rep Power: 136
mysticmind will become famous soon enough mysticmind will become famous soon enough
Send a message via Yahoo to mysticmind
id vs class play big roll in ajax
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 22-03-2008, 01:55 AM
hashie's Avatar
Inspired Webmaster
 
Join Date: Jun 2007
Location: Kuala Lumpur
Posts: 165
Rep Power: 17
hashie is on a distinguished road
haha simply description,

u lost ur id card, it doesn matter, u still can go for class..but there's no class, how u study? lol..jk..

just id represent for 1 thing, like ur id card never able to share with other, but class, just like u're planning to attend a programming class, there's thousand sections of classes where teaching programming (for you to choose) and all are also known as programming class. haha..hope u understand what am i explaining.

lol..
__________________
Hash here..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 22-03-2008, 02:35 AM
Novice Webmaster
 
Join Date: Jul 2007
Location: Malaysia
Posts: 81
Rep Power: 0
kaisology is on a distinguished road
Quote:
Originally Posted by mysticmind View Post
id vs class play big roll in ajax
what role they r playing in ajax?
haha here i comes another question: difference between 'ajax' and 'javascript'?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 22-03-2008, 05:41 PM
Novice Webmaster
 
Join Date: Mar 2008
Location: Sabah
Posts: 46
Rep Power: 0
Monie is on a distinguished road
Quote:
Originally Posted by kaisology View Post
hm I remember there is a thread about ID n CLASS here somehow it is lost (n i too lazy to dig it out), so i make a new thread here ask the same question again

where is the difference between id n class? when to use id when to use class? i experimentally used them to hold several kind of properties n both of them works pretty well, cant see the different??
I was wondering what ID and CLASS are you talking about?
Yipguseng has explain it well

You can learn about AJAX in OpenDNS
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 22-03-2008, 05:45 PM
Novice Webmaster
 
Join Date: Mar 2008
Location: Sabah
Posts: 46
Rep Power: 0
Monie is on a distinguished road
For some reason, I can't even edit my own post!!!

Anyway,
AJAX doesn't enhance Javascript. It relies on it. Javascript is a client side technology. It is purely run on the browser. AJAX can be thought of as interface between the technologies.
AJAX just uses javascript to communicate with the server in the form of XML. That's all. There's no magical difference between javascript and AJAX, AJAX is an implementation of javascript.

EDIT: the correct link is this: W3schools

Last edited by Monie : 22-03-2008 at 05:48 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 25-03-2008, 03:13 AM
Novice Webmaster
 
Join Date: Jul 2007
Location: Malaysia
Posts: 81
Rep Power: 0
kaisology is on a distinguished road
Quote:
Originally Posted by Monie View Post
For some reason, I can't even edit my own post!!!

Anyway,
AJAX doesn't enhance Javascript. It relies on it. Javascript is a client side technology. It is purely run on the browser. AJAX can be thought of as interface between the technologies.
AJAX just uses javascript to communicate with the server in the form of XML. That's all. There's no magical difference between javascript and AJAX, AJAX is an implementation of javascript.

EDIT: the correct link is this: W3schools
Still dont get what you meant...but thank you for the explaination at least you give me some idea d
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 26-03-2008, 11:24 PM
BasicCX's Avatar
Novice Webmaster
 
Join Date: Apr 2004
Location: Cheras, Selangor.
Posts: 51
Rep Power: 53
BasicCX is on a distinguished road
Send a message via Yahoo to BasicCX
Javascript and AJAX is no different at all. That why i wonder after quite some time leaving for a short time World Wide Web and suddenly come back heard about AJAX/WEB 2.0 etc. Look at the coding and realised that it is the same Javascript with wide application use only. Long time ago has build this kind of code. Just never give a name for it..haha
__________________
Check out: http://www.xpodonline.com
Hosting & Domain: http://www.cubiex.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 27-03-2008, 07:36 AM
shidi's Avatar
Novice Webmaster
 
Join Date: Apr 2004
Location: Ampang
Posts: 18
Rep Power: 0
shidi is on a distinguished road
Send a message via Yahoo to shidi
What being said from the first reply is true. Id should be unique in per page, i.e can only be use once. Where as class can be use repetitively.

Some might not see the importance of this, as they tend to use id instead of class again and again.

As for me, I followed this rule strictly since I'm using jQuery, a javascript framework for my works. On events such as, click, submit, etc, jQuery heavily depending on id and classes.

I believe for those who work a lot with Javascript, to say the least, would see the importance in differentiating id and class.
__________________
""If you must break the law, do it to seize power: in all other cases observe it." - Julius Caesar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



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

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spotlight: A class of many languages genzy Mamak Stall 2 06-07-2007 02:57 AM
what is the difference between trackback and ping? ladyfiesta Blogging Discussion 3 09-05-2007 03:59 AM
Multiple database class hajime Website Programming 4 02-09-2004 02:58 PM
Class nurulmajdi Website Programming 10 15-04-2004 12:03 AM
What's the difference between Flash and Director zaimlah Website Design 12 18-02-2004 12:00 AM



All times are GMT +8. The time now is 03:09 PM. Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57