使用javascript的警报框中的数据 [英] Data in alert box using javascript
本文介绍了使用javascript的警报框中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有功能,我尝试调用java脚本,并尝试在警告框中调用该数据,但警告框不填充代码是
我试试这个
我尝试过:
i have function and i try to call in java script and also try to call that data in alert box but alert box not populate code is
I try this
What I have tried:
<script type="text/javascript">
$('#submitchart').click(function () {
//alert("i");
var webmethod = 'WebForm1.aspx/Jqufunc';
$.ajax({
type: 'POST',
url: webmethod ,
data: JSON.stringify({ yearP: $('#yearValue').val() }),
contentType: 'application/json;charset=utf-8',
dataType: 'json',
success: function (response) {
debugger;
alert(JSON.stringify(response.d));
var data1 = response.d.split('*')[0];
var data2 = response.d.split('*')[1];
alert(data1);
alert(data2);
}
});
});
</script>
任何解决方案?
any solution?
推荐答案
(' #resentchart')。click(function(){
// alert(i);
var webmethod = ' WebForm1.aspx / Jqufunc';
('#submitchart').click(function () { //alert("i"); var webmethod = 'WebForm1.aspx/Jqufunc';
.ajax({
type:' POST',
url :webmethod,
data:JSON.stringify({yearP:
.ajax({ type: 'POST', url: webmethod , data: JSON.stringify({ yearP:
(' #yearValue')。val()}),
contentType:' applicati on / json; charset = utf-8',
dataType:' json',
成功:函数(响应){
debugger;
alert(JSON.stringify(response.d));
var data1 = response.d.split(' *')[ 0 ];
var data2 = response.d.split(' *')[ 1 ];
alert(data1);
alert(data2);
}
});
});
< / script >
('#yearValue').val() }), contentType: 'application/json;charset=utf-8', dataType: 'json', success: function (response) { debugger; alert(JSON.stringify(response.d)); var data1 = response.d.split('*')[0]; var data2 = response.d.split('*')[1]; alert(data1); alert(data2); } }); }); </script>
任何解决方案?
any solution?
这篇关于使用javascript的警报框中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文