开发者

Google App Engine, Jquery, load method

Hey all, new to App Engine and jQuery so here goes:

I want to dynamically load content into a 开发者_开发百科div using jQuery's load method on a click:

 $('#menu a').click(function(event) {
                event.preventDefault();
                var page = $(this).attr('href');
                $('#header').load(page);
        });

<div id="menu">
<ul>
  <li><a href="home.html" class="active">About</a></li>
  <li><a href="news.html">News</a></li>
</ul>
</div>
<div id="header">
</div>

If I'm currently at /home, using app engine, this routes me to /home/page instead of loading page into my <div id="header"> and leaving me at /home. The above code works without using app engine (meaning the content at page is dynamically loaded into my div and I stay at the URL /home). What am I missing?


You need to put the jquery below the menu HTML, or (recommended) inside a $(document).ready(function() { ... });


Are you sure you are running the appengine server?

There's no way you can access your own filesystem through the server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜