Front loading JS
$ (function () {
var publishstr= "<%=publishtext%>"
var marqueestr= "<marquee id=\" marquee0\ "onmouseover=\" this.stop () \ "Onmouseout=\" This.start () \ "Direction=\" "+ direction+ "\" scrollamount=\ "" +scrollamount+ "\" scrolldelay=\ "" +scrolldelay+ "\" ></marquee> ";
$ ("#pulishText_div"). Append (MARQUEESTR);
$ ("#marquee0"). HTML (htmldecode(PUBLISHSTR));
})
For Publishtext, it is htmlencode encoded in the background.
Main interface-Announcements-scrolling content Settings
private void Noticedataget (string CustomerId)
{
String sql = string. Format (@ "select configname,src from dbo. Tvipmemebershipcenterconfig WHERE configcode= ' publishtext ' and status= ' 1 ' and [email protected] ");
var bllinfo = Unityinvoker.getbllinfo (CustomerId, dbkeys.biz);
Dbparameterlist paras = new dbparameterlist ();
paras. ADD ("@CustomerId", SqlDbType.VarChar, CustomerId); The
DataSet DataSet = Unityinvoker.bllinvoke<ibll_sqlhelper> (DATAINVOKEMODE.LANDRIECTDB).
Filldata (Bllinfo, Sql,paras);
DataTable dt = dataset.tables["fztable"];
if (dt! = null && dt. Rows.Count > 0)
{
foreach (DataRow dr in Dt. Rows)
{
Publishtext + = "<a href=\\\" "+ Httputility.htmlencode (dr[" SRC "]. Convertstring ()) + "\\\" > "+httputility.htmlencode (dr[" ConfigName "]) +" </a><br> ";
}
}
Else {
Publishtext + = "<a href=\\\" javascript:void (0) \\\ "> Announcement content, announcement content </a><br>";
}
}
So to show the existing notes, and through the encoded string, it is necessary to do special processing in the foreground, decoding HtmlDecode
function HtmlEncode (str) {
var ele = document.createelement (' div ');
Ele.appendchild (document.createTextNode (str));
return ele.innerhtml;
}
function HtmlDecode (str) {
var ele = document.createelement (' div ');
ele.innerhtml = str;
return ele;
}
Dynamically add marquee tags and dynamically assign values and properties