Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Is this standard compliant or acceptable?
Old 03-29-2007, 03:48 AM Is this standard compliant or acceptable?
Extreme Talker

Posts: 169
Trades: 0
Hi,

I have a little bit of JS which just replaces contents. What I do is have a real link to another page with contents for users without JS.
I put an id onto the <a> so that I can replace it's href value by a javascipt:functionname(); parameter. This happens onload.
The page validates XHTML strict, but is this accepted, because in reality I am just beding the rules. I wanted to know people's opinions on this.
__________________
George Bush would never take me alive.
MJM_RDS is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-30-2007, 04:45 AM Re: Is this standard compliant or acceptable?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Nope

it is perfectly correct and a good thing to do for accessibilty,

I don't see how you consider it's bending rules?
Who's rules and for what ?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-30-2007, 01:49 PM Re: Is this standard compliant or acceptable?
Extreme Talker

Posts: 169
Trades: 0
Well as far as I know you're not supposed to have links that refer to inline javascript and such. I was just asking to make sure I have a good way of approaching this.
__________________
George Bush would never take me alive.
MJM_RDS is offline
Reply With Quote
View Public Profile
 
Old 03-30-2007, 02:44 PM Re: Is this standard compliant or acceptable?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Well, it's bending in the sense that if you have a javascript link, you should have an HTML alternative. Something like this:

<a href="non-javascript-page" onclick="functionname()">Link</a>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-30-2007, 02:57 PM Re: Is this standard compliant or acceptable?
Extreme Talker

Posts: 169
Trades: 0
Well Adam, if the user doesn't have JavaScript the href points to a web page that basically looks like what the end result of the JS would look like.
__________________
George Bush would never take me alive.
MJM_RDS is offline
Reply With Quote
View Public Profile
 
Old 03-30-2007, 03:03 PM Re: Is this standard compliant or acceptable?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Then you're fine.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-30-2007, 04:02 PM Re: Is this standard compliant or acceptable?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yep, don't be concerned about it.

You are doing the transition the correct way around. Rather than rely on javascript being present, javascript is used to change the attribute.

So non JVM enabled user agents (including the validator and SE crawlers) get the standard href while JVM enabled devices insert the function call.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-30-2007, 04:42 PM Re: Is this standard compliant or acceptable?
Extreme Talker

Posts: 169
Trades: 0
Ok thanks. I just always heard about it being bad, so the way I do it is good. So that's cool. Thanks.
__________________
George Bush would never take me alive.
MJM_RDS is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Is this standard compliant or acceptable?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.26589 seconds with 12 queries