asp获取js中的变量的值,请问如何才能输出i的值
<html><head><title>js学习</title></head><body><script>functioncity(){vari=document.getE...
<html>
<head><title>js学习</title></head>
<body>
<script>
function city(){
var i=document.getElementById('myselect').value;
alert(i);
}
</script>
<select id="myselect" onChange="city()">
<option value="fist">1</option>
<option value="second">2</option>
<option value="third">3</option>
</select>
<%
dim a
a="<script>document.write(i);</script>"
response.Write a
%>
</body>
</html>
如何通过异步处理的方式把i的值传给A呢 展开
<head><title>js学习</title></head>
<body>
<script>
function city(){
var i=document.getElementById('myselect').value;
alert(i);
}
</script>
<select id="myselect" onChange="city()">
<option value="fist">1</option>
<option value="second">2</option>
<option value="third">3</option>
</select>
<%
dim a
a="<script>document.write(i);</script>"
response.Write a
%>
</body>
</html>
如何通过异步处理的方式把i的值传给A呢 展开
4个回答
展开全部
<script src="js/jquery-1.5.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$.post("CacheDemo.aspx", { "strWidth": window.screen.width,"strHeight":window.screen.height }, function(data, status) {
if (status == "success") {
}
});
});
</script>
<script type="text/javascript">
$(function() {
$.post("CacheDemo.aspx", { "strWidth": window.screen.width,"strHeight":window.screen.height }, function(data, status) {
if (status == "success") {
}
});
});
</script>
展开全部
使用Ajax 方式与后台交互。
然后通过AJax 返回的对象给A赋值
然后通过AJax 返回的对象给A赋值
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<html>
<head><title>js学习</title></head>
<body>
<script>
function city(){
var i=document.getElementById('myselect').value;
document.getElementById('view').innerHTML = i;
//alert(i);
}
</script>
<select id="myselect" onChange="city()">
<option value="fist">1</option>
<option value="second">2</option>
<option value="third">3</option>
</select>
<div id="view"></div>
</body>
</html>
<head><title>js学习</title></head>
<body>
<script>
function city(){
var i=document.getElementById('myselect').value;
document.getElementById('view').innerHTML = i;
//alert(i);
}
</script>
<select id="myselect" onChange="city()">
<option value="fist">1</option>
<option value="second">2</option>
<option value="third">3</option>
</select>
<div id="view"></div>
</body>
</html>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
window.location= "x.asp?a="+i;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询