Razor 2 asp.net Web サイトで Web Helpers パッケージを使用して、このように 2 つの Twitter ボックスを並べて表示できます。
<div id="dynaMashTab-Twitter" >
<span id="spanProfile" style="display: inline-block;vertical-align:top">@Twitter.Profile("jQuery")</span><span id="spanSearch"><span style="display: inline-block;vertical-align:top">@Twitter.Search("jQuery")</span>
</div>
...しかし、「jQuery」から何でも動的に変更できるようにしたいです。私はこの方法を試しました:
HTML:
<label for="inputQuery" style="display: inline-block;">Enter something, quick!</label>
<input type="text" name="inputQuery" id="inputQuery" placeholder="Enter something already" autofocus style="display: inline-block;" />
jQuery:
$(document).ready(function () {
$("#inputQuery").keyup(function(e) {
if (e.keyCode == 13) {
var inputQueryText = $("#inputQuery").val();
$("#spanProfile").html(@Twitter.Profile(inputQueryText));
$("#spanSearch").html(@Twitter.Search(inputQueryText));
}
});
});
...しかし、「名前 'inputQueryText' は現在のコンテキストに存在しません」
これが機能したとしても、#spanProfile と #spanSearch に割り当てているものが以前のようにフォーマットされないことはわかっていますが、これで赤ちゃんのステップから始めて、すでに少し転倒しています。