有時候會用html去取代物件裡的內容,但是當取代的文字過長的時候,很可能會沒有錯誤訊息,但是卻又無法正常顯示,尤其是IE8
var str = "過長的文字";
$(".asdasd").html();
此時我們最好使用以下的方式
var str = "過長的文字";
document.getElementById('Create_Menu').innerHTML = str;
就可以正常執行了
相關參考
http://localhost:2874/WWW20/scripts/Merge/Create_Menu.js
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
For I As Int32 = 1 To DT.Rows.Count
If order_num_right = DT.Rows(I - 1)("Pid") Then
Pid_No = I - 1
End If
#OFCL.Pid = DT.Rows(I - 1)("Pid")
#OFCL.GetDataRowAndReturnSelfOrNothing()
Dim NewT As String = oT.Result
NewT = NewT.Replace("#Y#", StartY + (I - 1) * LH)
NewT = NewT.Replace("#序號#", I.ToString)
NewT = NewT.Replace("#品號#", OFCL.Pid)
NewT = NewT.Replace("#品名#", OFCL.Product_Name)
NewT = NewT.Replace("#包裝#", OFCL.Package)
NewT = NewT.Replace("#單位#", OFCL.UNIT)
NewT = NewT.Replace("#數量#", OFCL.Qty)
NewT = NewT.Replace("#箱數#", OFCL.BOX)
NewT = NewT.Replace("#總數量#", OFCL.Total)
NewT = NewT.Replace("#未稅價#", OFCL.Price)
NewT = NewT.Replace("#總金額#", OFCL.Sum)
Res &= NewT
Next
Dim d As Date = Now
Dim n As Decimal = 86400.99
Dim Cultures() As String = {"zh-TW", "pt-BR", "pt-PT", "en-US", "en-GB", "fr-FR", "de-DE", "es-ES", "ja-JP", "zh-CN", "ko-KR", "en-IN"}
For i As Integer = 0 To Cultures.GetUpperBound(0)
Dim c As New Globalization.CultureInfo(Cultures(i))
Response.Write(Cultures(i) & "<br/>" & d.ToString("D", c) & " <br/>" & d.ToString("d", c) & "<br/>" & n.ToString("C", c))
Response.Write("<hr/>")
Next
zh-TW
2013年12月25日
2013/12/25
NT$86,400.99
pt-BR
quarta-feira, 25 de dezembro de 2013
25/12/2013
R$ 86.400,99
pt-PT
quarta-feira, 25 de Dezembro de 2013
25-12-2013
86.400,99 €
en-US
Wednesday, December 25, 2013
12/25/2013
$86,400.99
en-GB
25 December 2013
25/12/2013
£86,400.99
fr-FR
mercredi 25 décembre 2013
25/12/2013
86 400,99 €
de-DE
Mittwoch, 25. Dezember 2013
25.12.2013
86.400,99 €
es-ES
miércoles, 25 de diciembre de 2013
25/12/2013
86.400,99 €
ja-JP
2013年12月25日
2013/12/25
¥86,401
zh-CN
2013年12月25日
2013/12/25
¥86,400.99
ko-KR
2013년 12월 25일 수요일
2013-12-25
₩86,401
en-IN
25 December 2013
25-12-2013
₹ 86,400.99
function setPlaceholder(e) {
var placeholder = $(this).attr('placeholder');
if ($(this).val().length == 0) {
$(this).css("color", "#b2b2b2").val(placeholder);
}
$(this).focus(function (e) {
if ($(this).val() == placeholder) { $(this).css("color", "#666").val(""); }
});
$(this).blur(function (e) {
if ($(this).val().length == 0) { $(this).css("color", "#b2b2b2").val(placeholder); }
});
}
if (Is_LTE_IE9) {
$('input[placeholder]').each(setPlaceholder);
$('textarea[placeholder]').each(setPlaceholder);
}