简体   繁体   English

实现js变量的html标签

[英]implementing html tags of js variable

  • When I click open first window link a popup opens. 当我单击“打开第一个”窗口链接时,将弹出一个弹出窗口。
  • in that popup you will see a grid with two columns. 在该弹出窗口中,您将看到一个包含两列的网格。
  • in that first column i need to combine name and and icon. 在第一列中,我需要组合名称和图标。
  • so i added span tag before a tag but its not working. 所以我在标签之前添加了span标签,但无法正常工作。
  • can you guys tell me how to combine. 你们能告诉我如何结合吗?
  • providing code below. 在下面提供代码。

http://jsfiddle.net/cepzsokp/ http://jsfiddle.net/cepzsokp/

var a = $('<span></span><a/>', {
          class: 'sportsDataPlayer',
          download: 'download.csv',
          type: 'text/csv',
          href: URL.createObjectURL(data),
          html: ev.FileName
        });
        return a[0].outerHTML;

You can not do that html mark up. 您不能执行该html标记。 easiest thing would be just add the span before the outerHTML 最简单的方法是在外部HTML之前添加跨度

var a = $('<a></a>', {...})
return "<span></span>" + a[0].outerHTML;

I have edited your latest jsfiddle. 我已经编辑了您最新的jsfiddle。 Here is the working DEMO 这是工作中的演示

I have modified this line of code as below: 我修改了以下代码行:

return "<span onclick=&quot;window.open('" + model.mobileVersion + "', 'popup', 'width=800,height=600,scrollbars=yes,resizable=no')&quot; class='" + skyCloudmageProfilePic + " displayInlineBlock " + kendotxtMenu + "'></span>" + a[0].outerHTML;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM