حل مشكلة attribute name itemscope associated with an element type ol must be followed by = character

· 175 كلمة · 1 دقيقة قراءة

تحدث هذه المشكلة عندما نحاول اضافة كود html داخل تعديل كود قالب بلوجر. سبب هذه المشكلة هو ان قالب بلوجر لابد أن يكون صحيح بقواعد لغة xml لأن الكود مكتوب بلغة xhtml. لغة xhtml هي ببساطة عبارة عن html ولكنها حازمة جداً وتتبع قواعد xml.

أشهر ملاحظتين لابد أن تهتم بهم عندما تبدأ في تعديل كود xhtml هما 🔗

  1. غلق العناصر في html
  2. تحديد قيمة الـ attributes

مشكلة الـ itemscope هي أنها attribute ولا تحتوي علي قيمة، لذلك يقول لك أنه يتوقع وجود علامة يساوي “=” بعدها. لأنك لابد أن تعطي الـ attribute قيمة. لذلك حل هذه المشكلة هو اضافة قيمة itemscope.

هذا مثال لمشكلة عدم وجود قيمة لـ itemscope attribute 🔗

مشكلة attribute name itemscope associated with an element type ol must be followed by equal sign

والحل هو تعديل الكود ليصبح:

<ol itemscope="itemscope" itemtype="http://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope="itemscope"
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="https://example.com/dresses">
<span itemprop="name">Dresses</span></a>
<meta itemprop="position" content="1" />
</li>
<li itemprop="itemListElement" itemscope="itemscope"
itemtype="http://schema.org/ListItem">
<a itemprop="item" href="https://example.com/dresses/real">
<span itemprop="name">Real Dresses</span></a>
<meta itemprop="position" content="2" />
</li>
</ol>

ثم قم بالحفظ واختفت المشكلة الحمدلله.

لاحظ:

استبدل كل المرات التي ظهرت فيها itemscope بدون قيمة في الكود الي itemscope="itemscope" وستختفي كل المشكلات من الكود.

التصنيفات: برمجة
مشاركة:
waffarx cash back