简体   繁体   中英

Changing a JQuery UI tab name does not work with Internet Explorer

In Both Firefox and Chrome, I can dynamically change the text on a JQuery UI tab with:

$('#tabs ul:first li:eq(' + tabNumber + ') a').append(" ( " + counter + " )");

However, this is not working with Internet Explorer 9. The .append() function is not the culprit, it seems to be that IE cannot find '#tabs ul:first li:eq(' + tabNumber + ') a' .

Does anyone know of a possible fix for this?

Thanks!

Fixed by setting tabNumber as

var tabNumber = tabId.charAt( tabId.length-1 ) - 1;

instead of

var tabNumber = tabId[tabId.length - 1] - 1;

The latter does not seem to work with IE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM