api_boniu_get_info_by_code.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>股票信息接口</title>
  6. <script type="text/javascript" src="js/jquery.1.9.1.min.js"></script>
  7. <script type="text/javascript" src="js/func.common.js"></script>
  8. <script type="text/javascript" src="js/func.js"></script>
  9. <script type="text/javascript" src="js/jquery.md5.js">//$.md5()</script>
  10. <script type="text/javascript" src="js/jquery.base64.js">//$.base64.encode()</script>
  11. <script src="js/c.js" type="text/javascript"></script>
  12. <script src="js/urchin.js" type="text/javascript"></script>
  13. <link href="css/s.css" type="text/css" rel="stylesheet">
  14. <link href="css/base.css" type="text/css" rel="stylesheet">
  15. <script type="text/javascript">
  16. $(function(){
  17. $('#btn').click(function(){
  18. var method = $('input[name="method"]').val();
  19. var code = $('input[name="code"]').val();
  20. var timestamp = $('input[name="timestamp"]').val();
  21. var sign = $.md5(method+timestamp);
  22. $('#sign').val(sign);
  23. $.ajax({
  24. type : 'POST',
  25. data : {
  26. 'method' :method,
  27. 'code' :code,
  28. 'timestamp' :timestamp,
  29. 'sign' : sign
  30. },
  31. url : "../api.php",
  32. beforeSend : function(data){
  33. $('#Canvas').html('<p>请求处理中...</p>');
  34. },
  35. success : function(data){
  36. alert(data);
  37. Process(data);
  38. },
  39. error : function(request, errtext, e){
  40. $('#Canvas').html('<p><b>发生错误</b></p><p>'+request.status+'<br/>'+errtext+'</p>');
  41. }
  42. });
  43. });
  44. });
  45. </script>
  46. </head>
  47. <body>
  48. <div id="head"><p>数据中心向回朔系统通过code获取股票信息</p></div>
  49. <div id="content">
  50. <div id="left">
  51. <div class ="message"><p>接口返回:</p></div>
  52. <div id="Canvas" class="Canvas"></div>
  53. </div>
  54. <div id="right">
  55. <div class ="message"><p>请求数据:</p></div>
  56. <form>
  57. <p>
  58. <span>method:</span>
  59. <input type="text" class="input-text" name="method" value="api_boniu_get_info_by_code"/>
  60. </p>
  61. <p>
  62. <span>timestamp:</span>
  63. <input type="text" class="input-text" name="timestamp" value="11111111"/>
  64. </p>
  65. <p>
  66. <span>code</span>
  67. <input type="text" class="input-text" name="code" value="600008"/>
  68. </p>
  69. <p>
  70. </p>
  71. <p><span>校验码:</span><input type="text" class="input-text" id="sign" readonly/></p>
  72. <p><button class="button success small" id="btn" type="button">发送请求</button></p>
  73. </form>
  74. </div>
  75. </div>
  76. </body>
  77. </html>