문제

I have a asp.net mvc4 project and i use bootstrap template. So far so good, but also I need to use BxSlider.

I was used BxSlider before in MVC without any problem, so may be the conflict is with bootstrap.

I receive error : Uncaught TypeError: Object [object Object] has no method 'bxSlider'

on this line :

$('.bxslider').bxSlider({

Everything else work correct, i don`t have jquery conflicts or etc.

I would appreciate any help .. thanks in advance ..

도움이 되었습니까?

해결책 2

Thank for all ideas .. found a solution..

I was add bxslider lib in top of my View.. after that i call init script for bgSlider(again in this view file).

Now i move out load of lib in bottom in master layout view and after it load init and now it`s work.

Honestly i don`t see what is the problem here .. In this view i loaded already other Js libs and they work correctly.

다른 팁

The mentioned error refers to 2 possible mistakes:

  1. undefined jquery before named library, say BxSlider.
  2. Undefined named library after jquery library.

Note that These types of errors are more possible in Microsoft MVC Architecture, because of availability of section definitions or partial uses, and in one phrase, more Programmer tools to work easier! So be careful in case of calling js libraries in such tools in Microsoft MVC. I suggest you to trace/track related view from main layout (perhaps _Layout.cshtml) until complete view to be rendered. You can use some techniques like required : false to avoid multiple resource calls in RenderSection too.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top