首页 > 解决方案 > 如何在新的浏览器选项卡中加载引导程序

问题描述

我正在运行一个抓取表单的代码,然后使用以下格式打开一个带有数据的新浏览器选项卡: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);如何使用引导程序格式化表格时?

标签: javascriptjquerybootstrap-modal

解决方案


推荐阅读