Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



SEO Class in Chicago, IL

Learn How To Optimize Your Website on July 26, 2013


Looking for personalized in-depth SEO training among your peers?



High Rankings is offering a 1-day customized SEO training class in Chicago. Class size is limited so please sign-up now if you want in!



 


Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Validation Vs Javascript


  • Please log in to reply
7 replies to this topic

#1 -=seth=-

-=seth=-

    HR 4

  • Active Members
  • PipPipPipPip
  • 123 posts

Posted 29 November 2006 - 12:27 PM

Is it possible to use doctype xhtml1.0 Strict, then have javascript in the page content (with lots of = and ? in the javascript coding) and still make the page validate to w3c requirements or am I wasting my time trying

Also am I worrying over nothing, I understand search engines ignore javascript, if w3c picks up errors and it in the javascript, should I simply not worry about it

thanks in advance for your help and suggestions

#2 mal4mac

mal4mac

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 610 posts

Posted 29 November 2006 - 02:28 PM

Strict barfs on too many goodies, I would stick to transitional if you want an easy life. Search engines don't like strict more than transitional and users will not see the difference so worrying about this is worrying about nothing for most web developers. If you have a serious theoretical interest in the future of the web then you might want to make the effort to make pages strict "when possible". But this will have as much impact on your profits as studying Ancient Greek.

#3 Akuta

Akuta

    HR 3

  • Active Members
  • PipPipPip
  • 66 posts
  • Location:San Francisco

Posted 08 January 2007 - 09:14 PM

Yes, I believe you can validate XHTML pages with javascript in them as long as you remember to escape all occurrences of </ with \ resulting in <\/

#4 MaKa

MaKa

    HR 6

  • Active Members
  • PipPipPipPipPipPip
  • 856 posts
  • Location:Llantwit Major, Wales, UK

Posted 09 January 2007 - 03:38 AM

Or simply place all your javascript in an external file, that's what I did for my latest site.

#5 linux_lover

linux_lover

    LiLo

  • Active Members
  • PipPipPipPipPipPip
  • 831 posts
  • Location:York, UK

Posted 09 January 2007 - 04:23 AM

Actually the right way to do it is to wrap your code in CDATA tags e.g.

CODE
<script>
<![CDATA[
// Your javascript code
]]>
</script>


Everything inside a CDATA section is ignored by the XHTML parser.

#6 W3Daryl

W3Daryl

    HR 1

  • Members
  • Pip
  • 9 posts

Posted 13 June 2007 - 12:53 PM

I personally use XHTML Transitions unless specifically requested otherwise by a client. Strict has a lot of rules which conflict with some SEO Practicies. My biggest complaint about Strict is they removed the target="_blank", you can use Javscript to open a new window with a rel="external", but then you stuck if you want to put a rel="nofollow" on the links. I also place as much javascript as possible in external files. Cheers.

#7 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 5,888 posts
  • Location:Blackpool UK

Posted 13 June 2007 - 01:22 PM

"they" haven't removed the target attribute at all.

It is still perfectly valid in the DTD where it has any meaning and where it has only had real meaning since the very first days of HTML, and that is the Frameset DTD.

In any thing other than a frameset there can be no valid target frame.

#8 torka

torka

    Vintage Babe

  • Moderator
  • 4,392 posts
  • Location:Triangle area, NC, USA, Earth (usually)

Posted 14 June 2007 - 09:41 AM

Which, of course, has done nothing to stop many of us with a huge pragmatic streak from employing this lowly attribute in ways it may never have been intended, simply because it works very neatly to do something we find on occasion to be useful. smile.gif

--Torka mf_prop.gif




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users