开发者

How can I load a page by clicking on a menu bar without reloading the page

I have a menu, and I would like to load a page without refreshing it in the browser.

T开发者_C百科he pages to be loaded are in jsp.


You should use ajax for this.

for example using jQuery:

onClick="$('#id').load('/path/jspfile.jsp');"

id is the id of the place you want to plant the page into.


You need to load content from other page. see example below you index.html and contact.html

<li><a onClick="$('.content').load('test.html');" href="#contact">Contact</a></li>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜