简体   繁体   English

如何在我的.js文件中使用超赞的标签

[英]How to use font-awesome tags in my .js file

I want to replace the image with font-awesome icons in my .js file. 我想用.js文件中的超棒图标替换图像。

My file is as follows 我的档案如下

"</head>"+
"<body bgcolor=\"White\">"+

"<table width=\"100%\" height=\"100%\" cellpadding=0 cellspacing=0 border=0>"+
"<tr height=\"100%\" bgcolor=\"#FFFFFF\"><td valign=top>"+

"<table class=\"clsOTable\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"+
"<tr><td bgcolor=\"#4E4E4E\">\n"+
"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n"+
"<tr>\n "+
"   <td height='60px' align=left bgcolor=\"#4E4E4E\" colspan=\"7\">"+
"<table width=100% height=40 border=\"0\"><tr><td width=50 ><a href=\"dateconsole.jsp?controlname="+

 str_target+"&date="+ dt2dtstr(dt_prev_year)+dt2tmstr(dt_datetime)+"\">"+
 "<img src=\"../images/prevpopyr.gif\" width=\"50px\" height=\"50px\" border=\"0\""+
 " alt=\"previous year\"></a></td><td width=50 ><a href=\"dateconsole.jsp?controlname="+
 str_target+"&date="+ dt2dtstr(dt_prev_month)+dt2tmstr(dt_datetime)+"\">"+
 **"<img src=\"../images/prevpop.gif\**" width=\"50px\" height=\"50px\" border=\"0\""+
 " alt=\"previous month\"></a></td><td align=center ><font color=\"white\" face=\"tahoma, verdana\" size=\"4\">"+
 arr_months[dt_datetime.getMonth()]+" "+dt_datetime.getFullYear()+"</font>+"

I tried putting in the head tag 我尝试戴上头标

<head>

"<link rel='stylesheet' href='<util:getAbsoluteURL URL="css/font-awesome.css" />' type="text/css" media="screen">+"

</head>

and replacing the 并更换

<img src=\"../images/prevpopyr.gif\" width=\"50px\" height=\"50px\" border=\"0\""+
    " alt=\"previous year\">

with the

<i class="fa fa-forward"></i>

font-awesome tag. 真棒字体标签。

but it does not work? 但这行不通吗? Please suggest. 请提出建议。

Have you tried following the instructions for Getting Started with font awesome? 您是否尝试按照有关真棒字体入门的说明进行操作? http://fortawesome.github.io/Font-Awesome/get-started/ http://fortawesome.github.io/Font-Awesome/get-started/

Try replacing the link you've got in your head tag with 尝试将标头标记中的链接替换为

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">

and see if that works. 看看是否可行。 If it does, then we know the issue is with your local css font awesome location. 如果是这样,那么我们知道您的本地css字体位置很棒。

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

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