Old 06-07-2006, 16:55   #1 (permalink)
raygirl
Registered User
 
raygirl's Avatar
 
Join Date: Jul 2006
Posts: 21
Validating Javascript in XHTML

Hi Everyone,

I'm making a website for someone and although they're not bothered about the site being web compliant I'm trying to do so out of good practice.

I have implemented graphic buttons that change on rollover using Javascript created in Dreamweaver MX. The problem is that when I try and validate the page it is fine without the javascript and does not seem to be fond to the external like to a Javascript file.


Has anyone had this issue before and how did you combat it? Is the CDATA action better? I'd very much appreciate your help in this matter.

-----------------
Raygirl
  Reply With Quote
Old 06-07-2006, 17:12   #2 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
  Reply With Quote
Old 06-07-2006, 17:31   #3 (permalink)
raygirl
Registered User
 
raygirl's Avatar
 
Join Date: Jul 2006
Posts: 21
You know what pgo?

You're right. I think I'm being lazy maybe because I was up at five this morning and need to get a good few hours' shut eye.

Thanks for the link and many thanks for your help!
  Reply With Quote
Old 06-07-2006, 18:04   #4 (permalink)
LadynRed
Senior Member
 
Join Date: Mar 2006
Posts: 147
If you do put javascript in a page, wrapping it in [CDATA] will keep the validator from choking on it.
  Reply With Quote
Old 06-07-2006, 19:59   #5 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Quote:
Originally Posted by raygirl
You know what pgo?

You're right.
What else is new?
  Reply With Quote
Old 08-07-2006, 05:56   #6 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 840
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Quote:
Originally Posted by pgo
What else is new?
Ah, there's nothing quite like that slice of humble pie...

- Mike
  Reply With Quote
Old 08-07-2006, 10:04   #7 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
A la mode, naturally.
  Reply With Quote
Old 08-07-2006, 10:13   #8 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 840
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
In general, I agree with PGO that your image rollovers would be better of being handled with CSS.

The validator shouldn't specifically be choking on the JavaScript unless your markup isn't totally correct. I also couldn't quite understand what you meant in your original post; does the validator screw up when you link to an external JavaScript file ? Or when you have the JavaScript code inline in your HTML document ?

If you could perhaps show us the code (or post a link to the page) you're using then I could take a look at it and get a better understanding of what's going wrong and see how to remedy it.

However, if you now don't need the JavaScript at all since you will be going with CSS instead then fair play, it's all good.



- Mike
  Reply With Quote
Old 09-07-2006, 09:16   #9 (permalink)
raygirl
Registered User
 
raygirl's Avatar
 
Join Date: Jul 2006
Posts: 21
Mike,

No it's something really simple that can be fixed with CSS so I'm going down that route.

The task I was doing was actualy looking into a website someone else had already developed but itwas riddled with bugs. I can't believe that there are companies out there who claim they have experience in developing great sites at a professional level but can't even have a page conforming to web standards...

Thanks for your help everyone
  Reply With Quote
Old 10-07-2006, 06:20   #10 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 840
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Quote:
Originally Posted by raygirl
I can't believe that there are companies out there who claim they have experience in developing great sites at a professional level but can't even have a page conforming to web standards...
Yes it is rather shocking isn't it !!

- Mike
  Reply With Quote
Reply



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

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8