Author Topic: How to pass the W3C check, follow me!  (Read 12220 times)

0 Members and 1 Guest are viewing this topic.

Yiwu

  • Jr. Member
  • **
  • Posts: 3
How to pass the W3C check, follow me!
« on: April 09, 2009, 07:15:31 AM »
the orignial code:
Quote
<!-- webim button --><a href="/webim/client.php?locale=zh-cn" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 &amp;&amp; window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/webim/client.php?locale=zh-cn&amp;url='+escape(document.location.href)+'&amp;referrer='+escape(document.referrer), 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&amp;lang=zh-cn" border="0" width="148" height="45" alt=""/></a><!-- / webim button -->

the w3c standard code:

Quote
<script type="text/javascript">
 // <![CDATA[
 function kefu()
 {
 if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('http://www.***.com/webim/client.php?locale=zh-cn', 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=740,height=500,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;
 }
 // ]]>
 </script>
 <a href="#" onclick="kefu()"><img src="http://www.***.com/webim/button.php?image=webim" border="0" alt="袜子铺在线客服,订购热线" style="padding-top:10px;" /></a>

LOL, so the Webim is perfect now:)