Javascript 启用&;禁用输入
我有一个按钮,它被禁用了。但是当我点击iFrame时,我需要它来启用并刷新网页 这是我的按钮: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> 使用以下命令
<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不用担心:)