English 中文(简体)
如何在同一页上从不同的html网页上装载其他内容?
原标题:How can i load other content from a different html page on the same page?

I have this main page with several buttons ont it. I wonder how i can chance the content of a DIV with content on a different html page by clicking on the button. any tips would be great!

最佳回答
问题回答

欢迎圣克多里。 如果你不听从联邦议院的话,那么,人们会在此感到非常艰难。 你总是希望:

  1. Tell us what you ve tried
  2. Show us your code

如果你做这些事情的话,你会在这里找到一些令人惊讶的帮助(尽管已经消失了);

为了回答你的问题,你需要监测对你的导航要素的点击,并用上点击这一页。 你也希望确保你停止纽芬兰的缺席行动。 一切可以实现的目标如下:

$(document).ready(function() {
  $("#target").click(function(e) {
    $( #result ).load( file.html );
    e.preventDefault();
  });
});

在<代码>#target 是你的具体纽芬兰文的地方,#result 是你(在本页)上填满的,e.preventDefault( 阻止你纽芬兰做其他事情(大多数人认为这是劫持)。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签