javascript - 如何在新的浏览器选项卡中加载引导程序
问题描述
我正在运行一个抓取表单的代码,然后使用以下格式打开一个带有数据的新浏览器选项卡:fieldID、fieldLabel、filedValue
jQuery(document).ready(function(){jQuery('#helpdesk_ticket_submit').on('click', function(e){
submitText = "<table class='table'>"
submitText += ` <thead>
<tr>
<th scope="col">fieldID</th>
<th scope="col">fieldLabel</th>
<th scope="col">fieldValue</th>
</tr>
</thead>
<tbody>`
jQuery('#new_helpdesk_ticket input, #new_helpdesk_ticket select, #new_helpdesk_ticket textarea').each(
function(index){
var input = jQuery(this);
if (input.prev().is('textarea'))
if (input.attr('class').indexOf('hide') >= 0)
return;
let label = extractLabelText(input.attr('id')) //extrenal function to get the label of the field
submitText += "<tr><td>" + input.attr('id') + "</td><td>" + label + "</td><td> " + input.val() + "</td></tr>"
}
);
window.open().document.write(submitText);
代码没有问题。我的问题是当我window.open().document.write(submitText);
如何使用引导程序格式化表格时?
解决方案
推荐阅读
- html - 如何删除标题上方和每一侧的空白空间?
- php - Laravel 8.15.0/Jetstream - 如何注册新刀片 x-jet-newblade?
- wpf - 问:从 listview 绑定的文本框更新 viewmodel 属性
- kubernetes - K8s PersistentVolume 在多个 PersistentVolumeClaims 之间共享,用于本地测试
- javascript - 根据匹配数字删除/添加类
- python - Python如何在Docker中接收SIGINT以停止服务?
- javascript - (Svelte 3)我可以将图像放在使用它们的组件附近吗?
- python - 烧瓶邮件连接重置错误:[WinError 10054]
- c# - 扩展方法 Average() C#
- python - 树视图标题的活动背景颜色