DrPagel-FavIcon
« »

Verfasst am 15.01.2009 01:35:37 Uhr
Drahtseilakt zwischen validem HTML und validem Javascript-Link

Vor ein paar Stunden freute ich mich über valides HTML zu
<a href="javascript:Meinefunktion();">Testlink</a>
Doch da hatte ich mich zu früh gefreut. Der W3C-Link Checker gab gleich eine fette Warnung dafür heraus:
javascript:Meinefunktion();
What to do: You must change this link: people using a browser without JavaScript support will not be able to follow this link. See the Web Content Accessibility Guidelines on the use of scripting on the Web and the techniques on how to solve this.
Response status code: 501
Response message: Protocol scheme 'javascript' is not supported
Line: 96

Guter Rat ist teuer! Hier ist meine Idee:

<script type="text/javascript" language="JavaScript1.2"><!--
Out = '<';
Out += 'a href="javascript:strtEditor();" title="Editor needs Javascript"';
Out += '>';
Out += 'Testlink';
Out += '<';
Out += '/a';
Out += '>';
document.write(Out); //--
></script><noscript><table bgcolor="yellow" border="1"><tbody><tr><td><a href="">Testlink<br>function needs javascript</a></td></tr></tbody></table></noscript>
Dies sollte eigentlich beide Prüfprogramme zufrieden stellen.

Zufrieden kann ich jetzt die Nachtruhe beginnen! (dp)(1h)
archiviert (tbid2644.530): (dp) 15.01.2009 (+0,25h (+flagcounter +home.icon +navi +w3c_LiCh))
Haftungsausschluss
free counters
© drpagel.de Alle Rechte vorbehalten.