我写ajax就是为了得到结果&引用;结果5“;返回一些值。我需要在我的结果上加50。但我不明白 $.ajax({ url:“http://localhost:8000/solar/foo6", 键入:“获取”, 成功:功能(结果5){ res=resul
我写ajax就是为了得到结果&引用;结果5“;返回一些值。我需要在我的结果上加50。但我不明白我写ajax就是为了得到结果&引用;结果5“;返回一些值。我需要在我的结果上加50。但我不明白 $.ajax({ url:“http://localhost:8000/solar/foo6", 键入:“获取”, 成功:功能(结果5){ res=resul,ajax,Ajax,我写ajax就是为了得到结果&引用;结果5“;返回一些值。我需要在我的结果上加50。但我不明白 $.ajax({ url:“http://localhost:8000/solar/foo6", 键入:“获取”, 成功:功能(结果5){ res=result5[0][0].toFixed(1); console.log(res);/*在console中打印5.0*/ res1=res+100;/*错误*/ 控制台日志(res1); } }); <script type="text/jav
$.ajax({
url:“http://localhost:8000/solar/foo6",
键入:“获取”,
成功:功能(结果5){
res=result5[0][0].toFixed(1);
console.log(res);/*在console中打印5.0*/
res1=res+100;/*错误*/
控制台日志(res1);
}
});
<script type="text/javascript">
$.ajax({
url:"http://localhost:8000/solar/foo6",
type:"GET",
success:function(result5){
res = result5[0][0].toFixed(1);
console.log(res); /* prints 5.0 in console */
res1=res+100; /* error */
console.log(res1);
}
});
</script>