Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 启用&;禁用输入_Javascript_Jquery_Iframe - Fatal编程技术网

Javascript 启用&;禁用输入

Javascript 启用&;禁用输入,javascript,jquery,iframe,Javascript,Jquery,Iframe,我有一个按钮,它被禁用了。但是当我点击iFrame时,我需要它来启用并刷新网页 这是我的按钮: <input class="" id="deshacer" type="button" value="Deshacer cambios" disabled/> 这是我的iFrame: <iframe id="probando" src="<?php echo $url; ?>" name="probando"></iframe> 使用以下命令

我有一个按钮,它被禁用了。但是当我点击iFrame时,我需要它来启用并刷新网页

这是我的按钮:

<input class="" id="deshacer" type="button"  value="Deshacer cambios"  disabled/>
这是我的iFrame:

<iframe  id="probando" src="<?php echo $url; ?>"  name="probando"></iframe>
使用以下命令:

$("#probando").on('click', function () {
   $("#deshacer").prop("disabled", false);                             
});
prop
而不是
attr
,以及
disabled
而不是
disabled

使用以下方法:

$("#probando").on('click', function () {
   $("#deshacer").prop("disabled", false);                             
});
prop
而不是
attr
,以及
disabled
而不是
disabled

使用以下方法:

$("#probando").on('click', function () {
   $("#deshacer").prop("disabled", false);                             
});
prop
而不是
attr
,以及
disabled
而不是
disabled

使用以下方法:

$("#probando").on('click', function () {
   $("#deshacer").prop("disabled", false);                             
});
prop
而不是
attr
,以及
禁用
而不是
禁用

尝试以下操作:

$("#probando").on('click', function () {
document.getElementById("deshacer").disabled = true;   
location.reload(true);                          
    });
试试这个:

$("#probando").on('click', function () {
document.getElementById("deshacer").disabled = true;   
location.reload(true);                          
    });
试试这个:

$("#probando").on('click', function () {
document.getElementById("deshacer").disabled = true;   
location.reload(true);                          
    });
试试这个:

$("#probando").on('click', function () {
document.getElementById("deshacer").disabled = true;   
location.reload(true);                          
    });

如果您的ifram url不在完全相同的域/子域上,那么您的问题很可能是源策略问题


作为安全措施,如果iframe的url指向另一个站点/域,javascript将无法访问iframe的内容。反过来也是如此:iframe中的JS代码无法“爬升”iframe

如果您的ifram url不在完全相同的域/子域上,那么您的问题很可能是源策略问题


作为安全措施,如果iframe的url指向另一个站点/域,javascript将无法访问iframe的内容。反过来也是如此:iframe中的JS代码无法“爬升”iframe

如果您的ifram url不在完全相同的域/子域上,那么您的问题很可能是源策略问题


作为安全措施,如果iframe的url指向另一个站点/域,javascript将无法访问iframe的内容。反过来也是如此:iframe中的JS代码无法“爬升”iframe

如果您的ifram url不在完全相同的域/子域上,那么您的问题很可能是源策略问题


作为安全措施,如果iframe的url指向另一个站点/域,javascript将无法访问iframe的内容。反过来也是如此:iframe中的JS代码无法“爬升”iframe

当我自己测试这个时,我遇到了一些麻烦,无法让
iframe
元素本身接受
click
事件

相反,我不得不使用
.contents()
。(见:)

以下是对我有效的方法:

$("#probando").contents().on('click', function () {
   $("#deshacer").prop("disabled", false);                             
});

演示:

当我自己测试这个时,我在让
iframe
元素本身接受
click
事件时遇到了一些问题

相反,我不得不使用
.contents()
。(见:)

以下是对我有效的方法:

$("#probando").contents().on('click', function () {
   $("#deshacer").prop("disabled", false);                             
});

演示:

当我自己测试这个时,我在让
iframe
元素本身接受
click
事件时遇到了一些问题

相反,我不得不使用
.contents()
。(见:)

以下是对我有效的方法:

$("#probando").contents().on('click', function () {
   $("#deshacer").prop("disabled", false);                             
});

演示:

当我自己测试这个时,我在让
iframe
元素本身接受
click
事件时遇到了一些问题

相反,我不得不使用
.contents()
。(见:)

以下是对我有效的方法:

$("#probando").contents().on('click', function () {
   $("#deshacer").prop("disabled", false);                             
});

演示:

您正在选择不存在的属性
“disable”
。)使用
“disabled”
您正在选择不存在的属性
“disable”
。)使用
“disabled”
您正在选择不存在的属性
“disable”
。)使用
“disabled”
您正在选择不存在的属性
“disable”
。)使用
“disabled”
我需要15个声望来解决问题抱歉我不能投票支持你:(@Lewis LOL不用担心:)我需要15个声望来解决问题抱歉我不能投票支持你:(@Lewis LOL不用担心:)我需要15个声望来解决问题抱歉我不能投票支持你:(@Lewis LOL不用担心:)我需要15个声望来解决这个问题抱歉我不能投票支持你:(@Lewis LOL不用担心:)