Google YahooMyWeb Digg Technorati Delicious Äîáàâèòü íà ÑÌÈ2 Äîáàâèòü íà Habr Äîáàâèòü íà Moi Novosti

Making JavaScript to be XHTML compliant

Eklenme Tarihi: December 17, 2007 04:52:27 AM
Ekleyen:
Kategori: Webmaster Kaynakları: Programlama-Seo

Every webmaster has experienced the need to create XHTML compliant web pages. If you are a web designer with clients I'm sure you've heard it many times from your clients who demand to have their web pages built this way. How do we make a page that contains DHTML scripts to be XHTML compliant? This is not a dificult process as you will see if you're reading this till the end.

There are two easy and short ways of doing this possible.

1: If we use inline Javascript, we can wrap the code inside the CDATA tag in, conjunction with some Javascript comments to show to the validator that our content from inside the script should not be validated as XHTML:
[code]
<script type="text/javascript">
/*<![CDATA[*/
//Javascript code here
/*]]>*/
</script>

We can also use another version, both of these wrappers will work:
[code]
<script type="text/javascript">
//<![CDATA[
//Javascript code here
//]]>
</script>

2: Another way of doing this is to remove the script from the page and store it in a .js file which will be called by our page like in the example from bellow:
[code]
<script type="text/javascript" src="thescript.js">
//A comment here
</script>

In this example "thescript.js" is the script itself stored into an external .js file (minus the surroundig "SCRIPT" tags. Comments within the script tags are still allowed.

source: http://www.roscripts.com/Making_JavaScript_to_be_XHTML_compliant-46.html

Oylama Yapabilmek icin giris yapmalisiniz. Ortalama: ( oy)

Yapilan Yorumlar
Gorus Yazabilmek icin giris yapin.

Yeni Makaleler

Understanding Goals and Conversion Optimization
If you use Google Analytics, you’re probably familiar with the terms Goals, and Conversions.
200 Adet pr1 - pr 4 dizin
200 Adet pr1 - pr 4 dizin
550 Adet Yüksek Prli Dizin
550 adet pr1 ve pr8 arası webdizini.
BaÅŸka Bir Dizin Listesi
Sitelerinizi ekleyebileceÄŸiz baÅŸka bir dizin siteleri listesi
pr9-pr5 web dizini adresleri listesi
pr9-pr5 pageranka sahip dizinlerin yer aldığı adres listesi

 Istatistikler

  • Aktif: 182
  • Onay Bekleyen: 0
  • Bugun Eklenen: 0
  • Makaleler: 39
  • Kategoriler: 18
  • Alt Kategoriler: 55

 Gunun Makalesi

Concealed Strategies Internet Marketing

"What am I doing wrong?" Sometimes you wonder how come competing websites get so many daily visitors

 Text Reklam

Bilgi Ve Eglence İksiri

 Yeni Eklenenler

 Adsense

 Alexa Stats