如何更好地編寫內容之間的HTML:[]?我有一個佈局內去,必須有一個更好的辦法...Razor HTML與JavaScript
<script type="text/javascript">
function OnClickAdd() {
$("#panelbar").kendoPanelBar();
var panelBar = $("#panelbar").data("kendoPanelBar");
panelBar.append(
{
text: "New Person",
encoded: false,
content: [
'<div id="cont6_container" class="container">',
'<span class="label label-primary">Age</span>',
'<br /><br />',
'<div class="btn-group" id=ageID>',
'<button type="button" style="width:120px" class="btnMyAge3 btn-default" id="3">Under 10</button><button type="button" style="width:120px" class="btnMyAge3 btn-default" id="1">Under 50</button><button type="button" style="width:120px" class="btnMyAge3 btn-default" id="2">Over 50</button>',
'@Html.TextBoxFor(m => m.ageID, new { @class = "input k-textbox", id = "MyAge3", Value = "", style = "width: 50px;" })',
'</div>',
'</div>'
]
}
)
}
爲什麼不把它的腳本標籤外,然後把它與jQuery? – trebor