w3c و title صحیح

foranyone

Well-Known Member
با سلام

داخل تگ title وقتی از جملات فارسی استفاده می کنم W3C تائید نمی کنه و این error رو میده:

کد:
You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include: 
[LIST]
[*]putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
[*]forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes), or
[*]using XHTML-style self-closing tags (such as <meta ... />) in HTML 4.01 or earlier. To fix, remove the extra slash ('/') character. For more information about the reasons for this, see [URL="http://www.cs.tut.fi/~jkorpela/html/empty.html"]Empty elements in SGML, HTML, XML, and XHTML[/URL].
[/LIST]

داخل تگ title هم از هز کدی استفاده شه (مثلا <p>) نمایش داده میشه!

چاره کار چیه؟
 

meysamz

Member
چك كنيد ببينيد صفحتون utf هست يا نه
داخل تگ title هم هر كدي استفاده كنيد به عنوان متن نمايش داده ميشه نه كد html
 

foranyone

Well-Known Member
به خاطر این گفتم داخل تگ title از p استفاده کردم که w3c خودش احتمال داد که شاید اشکال از این موضوع باشه

putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>), or
وگرنه می دونم هرچی داخل تگ title نوشته شه نشون داده میشه::wink:

اتفاقا w3c به خاطر استفاده از utf-8 بهم warning میده :D

The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported

راستش من یه title داینامیک برا صفحه در نظر گرفتم :

<title> <?php print("$siteTite"); ?> </title>

به احتمال قوی اگه خود متن رو بنویسم داخل صفحم w3c ایراد نمیگره ! ولی من اصرار دارم که حتما از title داینامیک استفاده کنم

به نظر شما چرا باید وقتی مقدارش با php چاپ میشه ایراد بگیره؟
 
آخرین ویرایش:

foranyone

Well-Known Member
مورد اول حل شد

اینو چیکار کنم؟!؟

the unicode byte-order mark (bom) in utf-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported
 

eAmin

Well-Known Member
مورد اول حل شد

اینو چیکار کنم؟!؟
سلام.

اینو توی قسمت php چندبار مطرح شده، برای حل این مشکل هم یک نرم افزار hexEditor پیدا کن و هر چی قبل تگ php که اول صفحه استفاده می شه رو حذف کن.( کاراکترهای عجیب غریبی هستن که بخاطر استفاده از بعضی از ادیتورها این مشکل پیش می یاد )
 

جدیدترین ارسال ها

بالا