weixin_33728268 2013-01-17 23:14 采纳率: 0%
浏览 13

应该是Ajax的简单用法

Is there a reason the following html not output correctly?

<html>
<script src="jquery_v1.9.js" style="text/javascript" />
<script style="text/javascript"> $("#container").load('partial.html')</script>

<body>
<h1>Partial Rendering Demo</h1>
<div id="container"></div>
</body>
</html>

I am using an example in the ASP.net MVC 4 book, the jquery file is just a copy/paste from the most up-to-date version, all the files are in the same directory, and the 'partial.html' folder simple contains an h2 element. The h2 element however, is never displayed when I run the main html.

Am I overlooking something?

  • 写回答

1条回答 默认 最新

  • weixin_33738578 2013-01-17 23:21
    关注

    Try this:

    <script src="jquery_v1.9.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function{
            $("#container").load('partial.html')
        });
    </script>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区