我的手柄文件中出现以下错误 -
" .K =" deleteTypePoke({{pokemon_pokemonid,TY ----------------------- ^ 期待ID',' STRING',' NUMBER',' BOOLEAN'' UNDEFINED',' NULL',' DATA',得到'无效'"
句柄不允许我传入我的两个变量,可能是由于逗号
{{#each typehaspokemon}}
<tr>
<td>{{pokemonname}}</td>
<td>{{typename}}</td>
<td><button onclick="deleteTypePoke({{pokemon_pokemonid,type_typeid}})">Delete</button></td>
</tr>
{{/each}}
这是我的javascript文件
function deleteTypePoke(pokemon_pokemonid, type_typeid){
$.ajax({
url: '/typehaspokemon/' + pokemon_pokemonid + '&' + type_typeid,
type: 'DELETE',
success: function(result){
window.location.reload(true);
}
})
};
如何通过把手将口袋妖怪ID和类型ID传递给此功能?
答案 0 :(得分:1)
<button onclick="deleteTypePoke({{pokemon_pokemonid}},{{type_typeid}})">Delete</button>