问题
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
- search
return N.toUpperCase()});
in jquery-1.3.2.min.js - 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
- Search for
return N.toUpperCase()});
in jquery-1.3.2.min.js. - 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