我正在尝试使用javascript将HTML表导出到Excel.这是javascript代码
<script type="text/javascript">
var tableToExcel = (function() {
var uri = 'data:application/vnd.ms-excel;base64,'
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
, base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
, format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
return function(table, name) {
if (!table.nodeType) table = document.getElementById(table)
var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
window.location.href = uri + base64(format(template, ctx))
}
})()
</script>
Run Code Online (Sandbox Code Playgroud)
这是我的标题
<meta http-equiv="content-type" content="application/vnd.ms-excel;" charset="UTF-8">
<meta charset="UTF-8">
Run Code Online (Sandbox Code Playgroud)
这是我的桌子 …
我正在使用bootstrap框架开发响应式网页,我想放置一个响应式iframe.
bootstrap文档说我可以使用响应式16x9宽高比iframe
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="…"></iframe>
</div>
Run Code Online (Sandbox Code Playgroud)
和css(包含在bootstrap.css中)是
.embed-responsive
{
display: block;
height: 0;
overflow: hidden;
position: relative;
}
.embed-responsive.embed-responsive-16by9
{
padding-bottom: 56.25%
}
.embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object
{
border: 0 none;
bottom: 0;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
结果是iframe的容器(具有类"嵌入响应......"的div)是响应的.这取决于分辨率的正确宽度和高度.但是iframe溢出了,因为它没有调整大小.
如何调整iframe的大小以准确填充div?
我使用 Firebase Cloud Messaging (FCM) 向各种 Android 智能手机发送推送通知。当智能手机有互联网连接时,一切正常。但如果智能手机没有互联网连接,通知就会丢失。
我的问题是,有没有办法在智能手机恢复互联网连接时发送通知?