我正在尝试从文本框中获取一个值,以便我可以使用 jQuery 旋转图像
<script src="Scripts/jQueryRotate.2.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
var angle = $("input:TextBox1").val();
$("#needle").rotate(angle);
alert(angle);
});
</script>
我正在填充文本框,如下所示
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
WeatherLibrary.WeatherData wLib = new WeatherLibrary.WeatherData();
double dataLatest;
string sensorName;
sensorName = "umtAdjWinDir";
double dir = wLib.GetLatestData(sensorName).Value;
dir = Math.Round(dir, 0);
TextBox1.Text = dir.ToString();
}
</script>
TextBox1 是文本框的 id
<asp:TextBox ID="TextBox1" runat="server" ReadOnly="True"></asp:TextBox>
我给出的警报说undefined
,图像永远不会旋转。