jquery li绑定ul语法问题

时间:2016-04-08 20:25:54

标签: javascript jquery syntax

我正在动态地将li标签添加到UL。以下是非常复杂的li标签,我正在接受语法问题。可以请任何人帮我修复以下标签。 任何形成这种链接的基本教程都很棒。

我正在尝试将链接与某些条件绑定。单击链接会打开一个新页面。



notifcationUL.append('<li><div class="pull-left"><a href="javascript:window.open(<%=ResolveUrl("~/App Web Pages/Generic/PageTableUIControl.aspx?Entity=Notifications&EntityObject=EIS_Notifications&UpdateModeLoad=false&WhereCondition=Main.[NotificationUserID]='"+ $("#hdnUser").val() + "' and Main.NotificationCreatedDate='" + today + "'%>",mywindowtitle)"><strong>See All Notifications</strong><i class="fa fa-angle-right"></i></a></div><div class="pull-right"> <a href="#" class="btn btn-sm btn-info removenotifications">Clear Notifications <span class="glyphicon glyphicon-trash pull-right "></span></a></div></li>');
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:0)

您无法使用jquery:/

将服务器端asp代码添加到客户端页面

你做的事情根本就是错误的。你能编辑你的问题来解释你想要达到的目的吗?

答案 1 :(得分:0)

您的报价已关闭。当您使用jQuery追加任何内容时,内部引号必须与外部引号相反。见下文。

你的语法:

CRITICAL   2016-04-08 15:28:47,063 testt:10 main HTTP Error 404: Not Found

正确的语法:

notifcationUL.append('<li><div class="pull-left"><a href="<%=Page.ResolveUrl("~/App Web Pages/Generic/PageTableUIControl.aspx?Entity=Notifications&EntityObject=EIS_Notifications&UpdateModeLoad=false&WhereCondition=Main.[NotificationUserID]='"+ $('#hdnUser").val() + "' and Main.NotificationCreatedDate=" + today + '%>","mywindowtitle")"><strong>See All Notifications</strong><i class="fa fa-angle-right"></i></a></div><div class="pull-right"> <a href="#" class="btn btn-sm btn-info removenotifications">Clear Notifications <span class="glyphicon glyphicon-trash pull-right "></span></a></div></li>');
相关问题