search

Home  >  Q&A  >  body text

The rewritten title is: Catching TypeError: this.removeClass is not a callable function

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粉409742142P粉409742142542 days ago564

reply all(1)I'll reply

  • P粉759451255

    P粉7594512552023-09-07 00:12:32

    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.

    reply
    0
  • Cancelreply