首页 新闻 会员 周边

ajax跨域问题

0
悬赏园豆:10 [已关闭问题] 关闭于 2015-09-11 11:00
$.get("http://192.168.100.179/Service/VisitViewNumber.ashx?id=5");

后台

private string  ViewNumber(HttpContext context)
        {
            string result = "";
            try
            {
                int ID = int.Parse(context.Request.QueryString["id"].ToString());
                SfSoft.BLL.WX_ActivityManage bll = new SfSoft.BLL.WX_ActivityManage();
                SfSoft.Model.WX_ActivityManage model = bll.GetModel(ID);
                if (model != null)
                {
                    if (model.ReadNumber != null)
                    {
                        model.ReadNumber += 1;
                    }
                    else
                    {
                        model.ReadNumber = 1;
                    }
                    bll.Update(model);
                }else{
                    return "error";
                }
                result = "ok";
            }
            catch (Exception ex)
            {
               return "错了!~    ";
            }
            return result;
        }            

执行:

$.get("http://192.168.100.179/Service/VisitViewNumber.ashx?id=5");
没有反映

我做这个的目的是统计这个页面的访问数
生活还是要继续的主页 生活还是要继续 | 初学一级 | 园豆:10
提问于:2015-09-10 18:39
< >
分享
所有回答(2)
0

你可以试试window.href

稳稳的河 | 园豆:4216 (老鸟四级) | 2015-09-10 19:56

这样用会跳到另外一个页面

不行的

支持(0) 反对(0) 生活还是要继续 | 园豆:10 (初学一级) | 2015-09-11 08:32
0

是我自己引用jquery库出错了

生活还是要继续 | 园豆:10 (初学一级) | 2015-09-11 10:58
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册