//判斷頁面上某物件是否存在的方式~
var str = "Hello Morse";
if (document.getElementById('Create_Menu')){
document.getElementById('Create_Menu').innerHTML = str;
}else{
}
相關文件
http://localhost:2874/WWW20/scripts/Merge/Create_Menu.js
有時候會用html去取代物件裡的內容,但是當取代的文字過長的時候,很可能會沒有錯誤訊息,但是卻又無法正常顯示,尤其是IE8
var str = "過長的文字";
$(".asdasd").html();
此時我們最好使用以下的方式
var str = "過長的文字";
document.getElementById('Create_Menu').innerHTML = str;
就可以正常執行了
相關參考
http://localhost:2874/WWW20/scripts/Merge/Create_Menu.js
Sub SendMail_godaddy(ByVal Subject As String, ByVal Body As String, ByVal FromMail As String, ByVal ToMail As String)
Dim objMail As New System.Web.Mail.MailMessage()
objMail.From = FromMail
objMail.To = ToMail
objMail.Subject = Subject
objMail.BodyFormat = Mail.MailFormat.Html
objMail.Priority = Mail.MailPriority.High
objMail.Body = Body
System.Web.Mail.SmtpMail.SmtpServer = UW.Mail.SMTP_SERVER_NAME
System.Web.Mail.SmtpMail.Send(objMail)
End Sub
Sub SendMail_gmail(ByVal Subject As String, ByVal Body As String, ByVal FromMail As String, ByVal ToMail As String)
Dim msg As New System.Net.Mail.MailMessage
Dim client As New System.Net.Mail.SmtpClient
Try
msg.Subject = Subject
msg.Body = Body
msg.From = New System.Net.Mail.MailAddress(FromMail)
msg.To.Add(ToMail)
msg.IsBodyHtml = True
client.Host = "smtp.gmail.com"
Dim basicauthenticationinfo As System.Net.NetworkCredential = New System.Net.NetworkCredential("username@gmail.com", "password")
client.Port = Int32.Parse("587")
client.EnableSsl = True
client.UseDefaultCredentials = False
client.Credentials = basicauthenticationinfo
client.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
client.Send(msg)
Catch ex As Exception
UW.WU.DebugWriteLine(ex.ToString, True, True)
End Try
End Sub
'更新
If UW.WU.IsNonEmptyFromQueryStringOrForm("Refresh") Then
System.Web.HttpContext.Current.Cache.Remove(CacheName)
End If
'快取部分
If obj Is Nothing Then
Dim SQL As String = ""
SQL = "select * from Product with (nolock)"
obj = UW.SQL.DTFromSQL(SQL)
Dim AC As New AggregateCacheDependency
Dim DepArray() As CacheDependency = { _
New SqlCacheDependency(UW.SQL.sqlCacheDependencyName, "Product"), _
New SqlCacheDependency(UW.SQL.sqlCacheDependencyName, "Product_Category") _
}
AC.Add(DepArray)
Dim FD As New CacheDependency(UW.Template.TemplateRoot & "2013UI\Product\DirectBuyAllProduct.html")
AC.Add(FD)
System.Web.HttpContext.Current.Cache.Insert(CacheName, obj, AC)
End If
StartP = StartP + StartKey.Length
Dim EndP As String = Source.IndexOf(EndKey, StringComparison.OrdinalIgnoreCase)
' 應該修改為以下寫法 =>
StartP = StartP + StartKey.Length
Dim EndP As String = Source.IndexOf(EndKey, StartP, StringComparison.OrdinalIgnoreCase)
0.0005085 No StartP
0.0002082 with StartP
0.0000157 StringComparison.Ordinal with StartP
0.0002768 StringComparison.OrdinalIgnoreCase, No StartP
0.0001105 StringComparison.OrdinalIgnoreCase with StartP
0.0002116 StringComparison.CurrentCulture with StartP
0.0002085 StringComparison.CurrentCultureIgnoreCase with StartP
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--Header S-->
<!--<title>{Title}</title>
<meta name="description" content="{Description}" />
<script type="text/javascript" src="{UNTJS}"></script>-->
<!--AutoScripts S--><!--AutoScripts E-->
<!--AutoCSS S--><!-- AutoCSS E-->
<!--Header E-->
</head>
<body>
<!--Content S-->
<!--FinalScript S-->
<script type="text/javascript">
$(document).ready(function () {
})
</script>
<!--FinalScript E-->
<!--Content E-->
</body>
</html>