소스 검색

object array operation done

night-cherry 1 개월 전
부모
커밋
73b87eff1a
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      index.js

+ 5 - 2
index.js

@@ -95,7 +95,7 @@ const app=createApp({
         console.log("--------parse tomcat server string--------");
         const res=JSON.parse(request.responseText);
 
-        _tomcat_res=res[1].title;
+        _tomcat_res=res[0].title;
         console.log("res:"+res);
         console.log("res[0].title :"+res[0].title);
         console.log("res[0].author :"+res[0].author);
@@ -112,7 +112,10 @@ const app=createApp({
         console.log("------  _books : "+_books);
         // console.log("------this.books : "+this.books);
         try{
-          _books.concat(res);
+          for(item in res){
+            _books.push(item);
+          }
+          // _books.concat(res);
         }catch(e){
           console.log("the way == _books.push(res[0])  is wrong!!!");
           try{