如何在iframe中动态加载页面 [英] How to load page dynamically in iframe

查看:675
本文介绍了如何在iframe中动态加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想在点击同一页面中的链接或按钮时在iframe中加载html页面。我用javascript动态加载页面。但是,我做不到。请有人指导我这样做。我的代码如下:

I just want to load an html page in iframe on clicking a link or button in the same page. I used javascript to load the page dynamically. But, I couldn't do that. Please anyone guide me to do that. My code is as follows:

document.getElementById("iframeelem").src="newhtml.jsp";


推荐答案

见这里。一个很好的帮助:

See here. A great help :

  • Loading pages in iframe dynamically

虽然有点偏离主题,但是很好旁读:

Though a bit off topic, a good side reading :

  • Loading external sites into Iframe dynamically - is there a better way??
  • How to dynamic load the document content into an iframe?

这篇关于如何在iframe中动态加载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆