当你点击链接时,有必要传输ip,这是'隐藏输入"在弹出框中并成为链接的一部分。例如,如果您点击第一个链接,则iframe src必须相等"http://ip-score.com/checkip/94.45.43.42"
如果是第二个 - "http://ip-score.com/checkip/83.218.164.204"
我试试,但是src没有改变...... jsfiddle.net
<a role='button' id='pop' data-toggle='popover' >
Check
<input id='ip_id' type='hidden' value='94.45.43.42'>
</a>
<a role='button' id='pop' data-toggle='popover' >
Check
<input id='ip_id' type='hidden' value='83.218.164.204'>
</a>
<script type="text/javascript">
$(document).ready(function(){
$('[data-toggle=popover]').popover({
content: function () {
var ip;
return ip= $(this).children("#ip_id").val();
frame.src = 'http://ip-score.com/checkip/'+ip;
},
template:
'<div class="popover" role="tooltip"> \
<div class="arrow"></div> \
<h3 class="popover-title"></h3> \
<div> \
<span class="popover-content" id="ip_view"></span> \
<div id="myPopoverContent">\
<div id="outerdiv"> \
<iframe src="http://ip-score.com/checkip/94.45.43.42" id="innerIframe" scrolling="no"></iframe> \
</div> \
</div> \
</div> \
</div>',
placement: 'bottom'
});
});
</script>