The rewritten title is: Catching TypeError: this.removeClass is not a callable function
P粉409742142
P粉409742142 2023-09-06 14:21:00
0
1
463

I have a common pagination code, in the form of cshtml as a partial view:

<div id="paging">
<span></span>
<span></span>
<a data-mini="true" class="action ui-btn" data-bind="css: previousPageEnabled() ? '' : 'ui-disabled'"><</a>
<a data-mini="true" class="action ui-btn" data-bind="css: nextPageEnabled() ? '' : 'ui-disabled'"><</a>
</div>

The corresponding js code is as follows:

(function($, model){
function injectPaging(viewModel. selector, pageSize){
//执行分页部分的代码
}
}

The main view uses jquery: jquery.mobile-1.4.5.js Through the debugger console, I get an error at this line (9408):

this.removeClass( "ui-flipswitch-input" );

Link to jquery page: http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js

The problem now is that this code works fine on all pages, because this paging code is used by all other views that implement pagination, only one view has the problem. I don't want to change anything in the jQuery file, and I have no idea what's causing this exact problem.

P粉409742142
P粉409742142

reply all(1)
P粉759451255

According to jquery-mobile's Github page, try replacing the relevant lines with the following code:

this.element.removeClass("ui-flipswitch-input");

You can try to update jquery-mobile to version 1.5.0-rc1, the bug seems to have been fixed in that version.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!