我试图复制当前页面在一个iframe (演示该页将如何在移动屏幕上)。但是页面不会加载在iframe中-它只是空白。你知道我的密码有什么问题吗?
$(document).ready(function(){
var iframe = $('#my-iframe', window.parent.document);
// if already in iframe
if (iframe.length > 0) {
$('<p>I\'m in an iframe!</p>').appe
我有一个带有iframe的页面。我的iframe页面是iframe.php,我的主页是main.php当我直接加载iframe.php时,我的jquery代码执行得很好,但是当我加载main.php (它包含iframe.php作为iframe)时,我得到一个错误"$ is not defined“。
这是不是因为main.php和iframe.php都使用
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script
我正在使用JQuery UI dialog的模式弹出窗口。我的页面中也有一些iframes。我从iframe打开模式对话框,但它将在iframe中打开。
我想当模型弹出是打开,然后用户不能允许点击背景链接。
所以请让我知道如何prevent user to click on background area
如何使jQuery在iFrame中调用父函数中的jQuery函数?
这里是iFrame的代码
<script>
$(document).ready(function (){
$("#Hey").click(function ()
{
parent.WorkPlease(); // does not work
window.parent.WorkPlease(); // also does not work
//
我使用jQuery创建一个iframe元素,onLoad调用父元素的jQuery函数之一。当父级调用额外的jQuery函数时,这会导致父级的$ is not defined。
看起来好像iframe已经引起了父母的jQuery的脱节。
iframe不是页面(src="about:blank")。
我认为iframe需要自己的JavaScript/jQuery环境,但我很难将其包含在内。
有什么想法吗?谢谢。
我有两个页面,我的index.html和social.html。我清理了我的索引,只留下了所需的jquery代码我试图做的是在social.html中放置图像,当点击它时,它会打开fancybox并显示它,但它是在index.html中显示的,而不是在iframe中。出现的错误是:
Uncaught TypeError: Property 'showImage' of object [object DOMWindow] is not a function
(anonymous function)social.html:103
onclick
这是我的index.html: