Computer Forums

Go Back   Computer Forums > Internet > Website Development

Website Development HTML, traffic, hosting, and more... this is the forum for every webmaster.

Register Now for FREE!
Computer Forums

Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Agree to forum rules 


Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-07-2007, 11:48 PM
Tom Tom is offline
Gigabyte
 
Join Date: 16 Mar 2007
Posts: 409
Tom is a jewel in the roughTom is a jewel in the roughTom is a jewel in the roughTom is a jewel in the rough
Exclamation [SOLVED] XHTML Help Needed

Need help here guys.

In my site I'm using XHTML 1.0 Strict with CSS. My pages Validate (W3C) fine, except for one thing: I need to add two elements in one tag/string, and not sure what is the correct syntax to seperate the items, while keeping them within the same tag.

This is a string sample:
Code:
<a href="http://www.example.com/files/map.pdf" onclick="javascript:urchinTracker ('/downloads/map'); ">
but in the string I need to add an additional 'onclick' attribute:
Code:
onclick="window.open(this.href); return false"
Can someone show me how to add this second element to the above string, that validates XHTML 1.0 Strict?

================================================== =======================
RESOLVED

I have found a resolution to my question below. In XHTML many HTML elements have been depreciated. Inserting styles in Strict has been more challenging, yet offering greater control.

One work-around to the problem, in long form, is to add a second line containing the second 'onclick' attribute.

However, the proper, and more shorter way is to add a semi-colon between the attributes, with the onclick=javascript attribute first, followed by the second.

This is the long way (but does work) in two seperate strings,
Code:
<li><a href="http://www.antivirus.comodo.com/" onclick="window.open(this.href); return false">Comodo Anti-Virus</a> Free life-time license (very good) | 34.4 MB
  <a href="http://www.antivirus.comodo.com/" onclick="javascript:urchinTracker('/security_apps/Comodo_Anti-Virus');"></a></li>
This is the right way, each attribute seperated by a semi-colon,
Code:
<li><a href="http://free.grisoft.com/freeweb.php/doc/5390/lng/us/tpl/v5#avg-anti-virus-free" onclick="javascript:urchinTracker('/security_apps/AVG_Anti-Virus'); window.open(this.href); return false">AVG Anti-Virus</a> by Grisoft (very good software) | 20.4 MB</li>
I found the resolution at W3C: - XHTML Style Attribute Module

Last edited by Tom; 06-11-2007 at 12:19 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
  #2 (permalink)  
Old 06-26-2007, 04:34 AM
Tom Tom is offline
Gigabyte
 
Join Date: 16 Mar 2007
Posts: 409
Tom is a jewel in the roughTom is a jewel in the roughTom is a jewel in the roughTom is a jewel in the rough
Default

Thread is solved. I really appreciate everyone's help. You've all been so helpful
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:09 PM.


Powered by: vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Content © Copyright 2005-2008 CompuForums. All Rights Reserved. Some content © Copyright of the respective owners.
Bankruptcy - Debt Consolidation - Credit Cards - Arizona Landscaping

Content Relevant URLs by vBSEO 3.2.0 RC5