invalid argument error of jquery accordion in IE

左心房为你撑大大i 提交于 2019-12-11 02:33:14

问题


The jquery accordion throws "Invalid argument." exception in IE(mine is IE8).

It works in Firefox and chrome. What may be the problem of jquery accordion with IE?

Here is the html:

<div id="accordion">      
   <h3><a href="#">Training</a></h3>
      <div>                
        <ul style="list-style: none;">
           <li><a href="/User/Index/4">Seminar</a></li>
        </ul>
      </div>
   <h3><a href="#">Meeting</a></h3>
      <div></div>
</div>

The js to call acordion:

 $(document).ready(
   function() {
     $("#accordion").accordion();
 });

The Error throws in jquery-1.3.2.min.js:

{J[G]=K}return J[G]},trim:function(E){return(E||"")

回答1:


As @mr.moses said, i have updated my jquery and ui to latest and it works well now.




回答2:


invalid argument jquery-1.3.2.min.js

then in all solutions post solutions as

  1. search return N.toUpperCase()}); in jquery-1.3.2.min.js
  2. add if(K=='Infinitypx'){K=''};if(K=='NaNpx'){K=''}; after searched stmt;

actually this was a bug in jquery-1.3.2.min.js where all the scnerios were not covered.

adding this will sort out that error and it will work smoothly.




回答3:


After trying many different solutions, I eventually had to do something slightly different:

invalid argument jquery-1.3.2.min.js

  1. Search for return N.toUpperCase()}); in jquery-1.3.2.min.js.
  2. add if(K=='nullpx'){K=''}; after the searched string.

Other solutions seem to suggest NaN rather then null, but after debugging it that was what was coming back.

Of course if you can, just upgrade your jQuery, but that was not a option for me.




回答4:


After trying out all different suggestions could not figure out a solutions.

if(K=='Infinitypx'){K=''};if(K=='NaNpx'){K=''};
if(K=='px'){K=''};
if(K=='nullpx'){K=''};

The value that is getting passed for 'K' in mycase id '-38px'.

I tried addding the below code to the jquery-1.3.2 as suggested in the steps above and did not get the js error.

if(K=='-38px'){K=''};


来源:https://stackoverflow.com/questions/2149279/invalid-argument-error-of-jquery-accordion-in-ie

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!