Browse Source

Merge branch 'master' of http://git.choozmo.com:3000/choozmo/HHH_Home_Decoration_2

Mike 3 years ago
parent
commit
66fa8e8c56
2 changed files with 33 additions and 20 deletions
  1. 32 19
      desktop11/goto.js
  2. 1 1
      desktop11/index.html

+ 32 - 19
desktop11/goto.js

@@ -91,35 +91,48 @@ function onClik() {
   var jsonString = JSON.stringify(jsonInfo);
   alert(jsonString);
   console.log(jsonString);
+  // $.ajax({
+  //   type: 'POST',
+  //   url: 'http://172.105.205.52:8001/deco_request_detail',
+  //   data: jsonString,
+  //   dataType: 'json',
+  //   success: function (data, textStatus, jqXHR) {
+
+  //     alert("送出成功");
+  //   },
+  //   complete: function () {
+  //     alert("complete");
+  //   },
+  //   beforeSend: function () {
+  //     alert("beforeSend");
+  //   },
+
+
+  //   error: function (jqXHR, textStatus, errorThrown) {
+  //     alert("送出失敗");
+
+  //   }
+  // });
+  // return false;
+
   $.ajax({
-    type:'POST',
     url:'http://172.105.205.52:8001/deco_request_detail',
-    data: jsonString,
+    type: 'POST',  // http method
+    data:jsonString, // data to submit
     dataType: 'json',
-    success: function (data, textStatus, jqXHR) {
-
-      alert("送出成功");
-    },
-    beforeSend: function () {
-      alert("beforeSend");
-    },
-    complete: function () {
-      alert("complete");
+    success: function (res) {
+        console.log(res);
     },
-
-    error: function (jqXHR, textStatus, errorThrown) {
-      
-      console.log(JSON.stringify(jqXHR));
-      console.log("AJAX error: " + textStatus + ' : ' + errorThrown);
-      alert("送出失敗");
-      
+    error: function (err) {
+        console.log(err);
     }
   });
-  
 }
 
 
 
+
+
 $("*").each(function (index, element) {
   // 此元素被點選後執行
   $(this).click(function (e) {

+ 1 - 1
desktop11/index.html

@@ -362,7 +362,7 @@
 
                     </div>
                     <div class="form-btn">
-                        <input class="btn" style="opacity: 1;" type="submit" onclick="onClik()" value="送出">
+                        <input class="btn" style="opacity: 1;" type="submit" onclick="onClik();" value="送出">
 
                     </div>
                 </form>