0Pricing
Web Accessibility Academy · درس

polite أم assertive: اختيار درجة الإلحاح

قرروا ما إذا كان التحديث سيقاطع المستخدم

polite أم assertive: اختيار درجة الإلحاح درس مجاني في Web Accessibility Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Web Accessibility Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

What a Live Region Is

A live region is an element a screen reader watches, so it speaks any text that changes inside it without the user moving focus there.

Two Politeness Levels

The aria-live attribute has two useful values you will reach for constantly: polite and assertive. They decide how an update is delivered. 🔊

Polite Waits Its Turn

With polite, the screen reader finishes whatever it is saying, then reads your update. It never cuts the user off mid-sentence.

<div aria-live="polite">Draft saved</div>

Assertive Interrupts Now

With assertive, the screen reader stops what it is reading and announces your update right away. Use it only when waiting would cost the user.

<div aria-live="assertive">Connection lost</div>

Polite Is the Default Choice

Reach for polite almost every time. Save, sort, filter, and progress updates can all wait a beat without confusing anyone.

Save Assertive for Real Urgency

Use assertive only for things the user must hear immediately, like a failed payment or a session about to expire.

There Is Also Off

The value off tells the screen reader to ignore changes in that element. It is the implicit default for elements you have not marked as live.

<div aria-live="off">Silent updates</div>

The Region Must Exist First

The live element should be in the DOM before the text changes. Screen readers watch existing regions, so add it empty and fill it later.

<div id="msg" aria-live="polite"></div>

Change Text, Not the Region

Announce by updating the text content inside the existing region. Swapping the whole region out can make the announcement silently fail.

document.getElementById('msg').textContent = 'Saved';

Assertive Can Pile Up

Fire several assertive updates fast and they fight each other, interrupting and talking over the last one. Polite queues them in order instead.

Match Urgency to Impact

Pick the level by asking how much an interruption helps. Most updates: polite. Errors and warnings the user must act on: assertive.

Quick Check

You add a small confirmation that a list was sorted. Which politeness level fits best?

Recap: Choosing Urgency

You learned that polite waits and assertive interrupts. Default to polite, reserve assertive for true urgency, and keep the region in the DOM. ✅

الأسئلة الشائعة

هل درس «polite أم assertive: اختيار درجة الإلحاح» مجاني؟

نعم — نص درس «polite أم assertive: اختيار درجة الإلحاح» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Web Accessibility Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Web Accessibility Academy 4 دروس في المجموع.

ماذا ستتعلم في «polite أم assertive: اختيار درجة الإلحاح»؟

قرروا ما إذا كان التحديث سيقاطع المستخدم تتمرن على Web Accessibility Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Web Accessibility Academy؟

لا تُشترط خبرة سابقة. Web Accessibility Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «polite أم assertive: اختيار درجة الإلحاح»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Web Accessibility Academy هذا؟

نعم. كل درس في Web Accessibility Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. polite أم assertive: اختيار درجة الإلحاح
  2. أدوار status وalert وlog
  3. الإعلان عن Toasts وأدوات التحميل والعدادات
  4. لماذا تفشل المناطق الحية وكيفية إصلاحها
← العودة إلى Web Accessibility Academy