Javascript 来自popover内容的引导ajax调用
我必须从Javascript 来自popover内容的引导ajax调用,javascript,jquery,html,ajax,twitter-bootstrap,Javascript,Jquery,Html,Ajax,Twitter Bootstrap,我必须从#id中的内容调用ajax或任何类型的post请求。 而#id是这样隐藏的: <div id="mycontents" style="display: none;"> <div class="btn-group" role="group"> <button type="button" class="btn btn-danger btn-sm" id="click_id">Click</button> <
#id
中的内容调用ajax或任何类型的post请求。
而#id
是这样隐藏的:
<div id="mycontents" style="display: none;">
<div class="btn-group" role="group">
<button type="button" class="btn btn-danger btn-sm" id="click_id">Click</button>
</div>
</div>
问题是一些浏览器忽略了display:none
元素,因此我无法从中触发任何事件
例如,当我单击按钮时,我想触发以下操作:
$('#click_id').click(function(e) {
$.ajax({
type: "GET",
url: "/click_id",
async: true,
dataType: "html",
success: function(data) {
// Do stuff
}
});
});
谢谢 试试这个:
$('#id').popover({
trigger : 'hover',
delay : {
show : 1,
hide : 10000
},
html : true,
content : function() {
var myhtml = $('#mycontents').html();
$('#mycontents', myhtml).removeAttr('style');
return myhtml
}
})
试试这个:
$('#id').popover({
trigger : 'hover',
delay : {
show : 1,
hide : 10000
},
html : true,
content : function() {
var myhtml = $('#mycontents').html();
$('#mycontents', myhtml).removeAttr('style');
return myhtml
}
})
请写下您的明确要求,以便stackoverflow能为您提供适当的解决方案,并添加更多说明。谢谢<代码>显示:无只是禁用了所有功能…你说“如何从这个#mycontents触发ajax调用?”是什么意思?你想什么时候触发这个请求。。?你想达到什么目的呢?你可以使用
$('#click_id:visible')。单击(
或$('#click_id:hidden')。单击(
-根据您的要求。@cvxv31431asdas-您对此有进一步的了解吗?希望看到解决方案!请写下您明确的要求,以便stackoverflow可以为您提供适当的解决方案添加更多的描述。谢谢。显示:无
只是禁用所有功能…什么意思“我如何从这个#mycontents触发ajax调用?”您想什么时候触发这个请求?您想实现什么?您可以使用$('#单击#id:visible')。单击(
或$('#单击#id:hidden')。单击(
)-根据您的要求。@cvxv31431asdas-您对此有进一步的了解吗?希望看到解决方案!