[技術討論] Jquery 請教

本帖最後由 carlkyo 於 2017-12-16 08:51 編輯

https://atandrastoth.co.uk/main/ ... /simple_jquery.html
  1. <script type="text/javascript">
  2.             var arg = {
  3.                 resultFunction: function(result) {
  4.                     $('body').append($('<li>' + result.format + ': ' + result.code + '</li>'));
  5.                 }
  6.             };
  7.             $("canvas").WebCodeCamJQuery(arg).data().plugin_WebCodeCamJQuery.play();
  8.         </script>
複製代碼
請問ching
我想改左ajax post result.code要點改啊
many thanks
我自己改唔到

咁result.code你想改成咩?

via HKEPC Reader for Android

TOP

咁result.code你想改成咩?

via HKEPC Reader for Android
gamezz 發表於 2017-12-16 23:09

我想ajax post 個result.code 去php return result
many thanks gamezz

TOP

  1. resultFunction: function(result) {
  2. $.ajax({url: "a.php", success: function(ajaxResult){
  3.         $('body').append($('<li>' + result.format + ': ' + ajaxResult + '</li>'));
  4.     }});
  5. }
複製代碼

TOP

gamezz 發表於 2017-12-18 21:35

thanks
  1. var arg = {
  2.                  resultFunction: function(result) {
  3.                      
  4.                                          $.ajax({
  5.                                                 url: '1.php',
  6.                                                 type: 'post',
  7.                                                 data: {format: result.format, code: result.code},
  8.                                                 success: function(data, status) {
  9.                                                 $('body').append($('<li>' + data + '</li>'));
  10.                                                 //if(data == "ok") {
  11.                                                
  12.                                                 //}
  13.                                                 },
  14.                                                 error: function(xhr, desc, err) {
  15.                                                         console.log(xhr);
  16.                                                 console.log("Details: " + desc + "\nError:" + err);
  17.                                                 }
  18.                                                 }); // end ajax call
  19.                                          
  20.                                          
  21.                                          
  22.                 }
  23.              };
  24.             $("canvas").WebCodeCamJQuery(arg).data().plugin_WebCodeCamJQuery.play();
  25.            
複製代碼

TOP