JQ load 实现局部刷新

DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>局部刷新demotitle>
  @Scripts.Render("~/bundles/jquery")
head>
<body>
  <a href="#" data-link="Demo1">Demo1a>
  <br>
  <a href="#" data-link="Demo2">Demo2a>
  <br>
  <a href="#" data-link="Demo3">Demo3a>
  <br>
  <div id="content"><h1>Indexh1>div>
  <script type="text/javascript">
    $('a').each(function() {
      this.onclick = function () {
        $('#content').load($(this).data("link"));
      };
    });
  script>
body>
html>

你可能感兴趣的:(JQ load 实现局部刷新)