i recieve error when launching javascript below:
if(ispartofindex(new array[25,20], indexclaimtyperow) ){ //display size listitem = '<li id="soze" data-theme="c"><h3>size:</h3>' + '<div data-role="fieldcontain" data-theme="c">' + '<fieldset data-role="controlgroup" data-type="horizontal" id="recieptvat">' + '<input type="radio" name="radio-choice-1" id="radio-choice-1" value="1.0" />' + '<label for="radio-choice-1">1.0</label>' + '<input type="radio" name="radio-choice-1" id="radio-choice-2" value="1.4" />' + '<label for="radio-choice-2">1.4</label>' + '<input type="radio" name="radio-choice-1" id="radio-choice-3" value="2.0" />' + '<label for="radio-choice-3">2.0</label>' + '</fieldset>' + '</div>' + '</li>'; $('#itemfieldslist').append(listitem); $('#itemfieldslist').listview('refresh'); }
the error message displayed is:
typeerror: 'undefined' not constructor (evaluating 'new array[25,20]')
here ispartofindex expects array first parameter
function ispartofindex(indexrow, indextype){ for(var = 0; < indexrow.length; i++){ if(indexrow[i] == indextype){ return true; } } return false; }
what doing wrong?
thanks
should new array(25, 20)
or [25, 20]
Comments
Post a Comment