这里我使用jquery框架的ajax技术

 

<script type="text/javascript" src="Assets/js/jquery.min.js"></script>
<script type="text/javascript">
function load1() {
$(function () {
$.ajax({
url: 'http://192.168.1.107:3000/product',
type: 'GET',
dataType: 'jsonp',
timeout: 1000,
cache: false,
beforeSend: LoadFunction, //加载执行方法
error: erryFunction, //错误执行方法
success: succFunction //成功执行方法
})
function LoadFunction() {

}

function erryFunction() {
alert("error");
}

function succFunction(data) {


for (var o in data) {
$("#product").append("<li><img src='" + data[o].image + "'/><div class='des'><p>" + data[o].name + "</p><a href='details.html?>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-02
  • 2021-12-29
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-01
  • 2022-01-15
  • 2021-10-03
  • 2022-12-23
  • 2022-01-06
  • 2021-06-01
  • 2022-12-23
相关资源
相似解决方案