我有一個搜索表單。當用戶提交表單時,ajax請求被髮送到服務器。當響應到來時,我更新找到的項目計數值,但JAWS讀取先前項目的計數值。 爲了讓JAWS讀取新內容,我使用了aria屬性和role =「status」。但JAWS仍然無法按預期工作。JAWS不會讀取動態內容。 IE11
我已經試過什麼: Getting screen reader to read new content added with JavaScript, aria-live and JAWS,ARIA Live Regions等
我在做什麼錯?
HTML
<form class="search-form">
<label class="keyword-search-input-label" for="keyword-search-input">
<span class="hide">Search</span>
<input class="form-control" type="text" id="keyword-search-input" name="keyword"/>
</label>
<button id="clear-field-button" type="reset">
<span class="hide">Clear Search Field</span>
</button>
<button id="search-button" type="submit" aria-describedby="number-found-items">
<span class="symbol-label">Search</span>
</button>
</form>
<div id="number-found-items" role="status" aria-live="assertive" aria-atomic="true" aria-relevant="all">
<span id="number-found">0</span>
items found
</div>
JS
function updateNumberFound(value) {
$numberFound.text(value || 0);
}
jsFiddle 要重現該問題試圖把重點放在搜索輸入,鍵入一些文字,然後按搜索按鈕,而JAWS上。
你能設置一個jsfiddle來重現問題嗎? – unobf 2015-03-19 12:20:38
@unobf,我添加了jsfiddle。你能檢查一下嗎? – iOne 2015-03-20 08:04:26