javascript按钮不显示 [英] javascript button not displaying

查看:119
本文介绍了javascript按钮不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码在表格行的一端创建一个蓝色按钮,链接到您是其中一个(您所在的行)的客户端的详细信息页面。此代码在Firefox中工作,但在Internet Explorer中没有任何按钮显示,因此您无法进入详细信息页面。有人可以建议一个解决方案,这将在IE和Firefox的工作?

The following code creates a blue button at one end of a table row that links to a detail page for the client that you are one (the row you are on). This code works in Firefox but in Internet Explorer no buttons show, so you cannot get to the detail page. Can someone suggest a solution to this that would work in both IE and Firefox?

$('#account-table tbody tr').each( function () {
            //nCloneTd.innerHTML = '<a href="../two/'+this.id+'"><button class="btn   btn-mini btn-primary" type="button">Detail</button></a>';
            nCloneTd.innerHTML = '<a href="'+this.id+'"><button class="btn btn-mini   btn-primary" type="button">Detail</button></a>';
            nCloneTd.id = "detail_cell";
            nCloneTd.className = "center";
            nCloneTd.bgColor = "white"
            this.insertBefore(  nCloneTd.cloneNode( true ),   this.childNodes[this.childNodes.length] );
          });


推荐答案

如何更改
nCloneTd.innerHTML ='< a href ='+ this.id +'>< button class =btn btn-mini btn-primarytype =button> Detail< / button>< / a>';

to nCloneTd.innerHTML = < a href ='+ this.id +'>< / a>< / button>< / a>;< button class ='btn btn-mini btn-primary'type ='button'> code>

to nCloneTd.innerHTML = "<a href='"+this.id+"'><button class='btn btn-mini btn-primary' type='button'>Detail</button></a>";

这篇关于javascript按钮不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆