top
Loading...
ASP+JS時的符號處理
在asp中basic語句中的字符串中包含js語句,這時處理起間隔符這特殊的符號確實是件麻煩事,苦于找不到相應的資料,一時
間頭痛萬分.現在好了,總算讓我想到了解決的辦法,原來我這么"后知后覺"啊,呵呵.

struserlist = struserlist & "<a href='#' onclick=" & chr(34) &_
"sendmsg('" & usernick & "');return false;" & chr(34) &_
" class='l_line'><span class=lineinfo>" & usernick & "</span></a>"


呵呵,還沒寫完,續上:

上面的StrUserList字串被賦值給另一個幀頁上的一個表單中隱藏文本單元:
if (top.LineInfo.document.forms.length == 1) {
top.LineInfo.document.forms[0].userlist.value = "<% =GetAppUserList() %>";
if (top.MainFrame.mylayer != null)
top.MainFrame.ShowLineInfo();
}


在主頁幀中顯示:

function ShowLineInfo()
{
var userlist;
if (top.LineInfo.document.forms.length == 1)
userlist = top.LineInfo.document.forms[0].userlist.value
else
userlist = "<span class='lineinfo'>Welcome to WWW.JSJ02.NET!</span>";
userlist = userlist + " <a href='<% =path %>/listuser.asp'>" +
"<span class='lineinfo'>顯示列表</span></a><a href='#' onclick='top.RefFrame.location=" +
""<% =path %>/refresh.asp?stat=manu"'><span class='lineinfo'> 刷新</span></a>";
if (mylayer != null)
{
mylayer.innerHTML = "";
mylayer.filters[0].Apply();
mylayer.innerHTML = userlist
mylayer.filters[0].Play();
}
}

mostone ( 2001-7-12 9:50:14 )

呵呵,還沒寫完,續上:

上面的StrUserList字串被賦值給另一個幀頁上的一個表單中隱藏文本單元:
if (top.LineInfo.document.forms.length == 1) {
top.LineInfo.document.forms[0].userlist.value = "<% =GetAppUserList() %>";
if (top.MainFrame.mylayer != null)
top.MainFrame.ShowLineInfo();
}


在主頁幀中顯示:

function ShowLineInfo()
{
var userlist;
if (top.LineInfo.document.forms.length == 1)
userlist = top.LineInfo.document.forms[0].userlist.value
else
userlist = "<span class='lineinfo'>Welcome to WWW.JSJ02.NET!</span>";
userlist = userlist + " <a href='<% =path %>/listuser.asp'>" +
"<span class='lineinfo'>顯示列表</span></a><a href='#' onclick='top.RefFrame.location=" +
""<% =path %>/refresh.asp?stat=manu"'><span class='lineinfo'> 刷新</span></a>";
if (mylayer != null)
{
mylayer.innerHTML = "";
mylayer.filters[0].Apply();
mylayer.innerHTML = userlist
mylayer.filters[0].Play();
}
}


北斗有巢氏 有巢氏北斗