通过script动态添加数据

<script type="text/javascript" src="/task/js/empty.js?time=<%=DateTime.Now.ToString("HHmmssff") %>" onload="create_num_dom.call(this)" data-attr="<%=item["userid_t"] %>" ></script>  

function create_num_dom() {
  var $that = $(this), attr = $that.data('attr');

  var $num = $("<span class='num'>&nbsp;&nbsp;&nbsp;成交量:"+attr+"</span>");
  $that.before($num).remove();
}

说明:
1. empty.js是个空链接
posted @ 2018-08-11 11:28  DR19  阅读(678)  评论(0编辑  收藏  举报