dhl: ajax 는 도 메 인 을 넘 어 getJSON 으로 바 꿀 수 없습니다.

3046 단어 application
/ / ajax 도 메 인 을 넘 어 getJSON 으로 변경 할 수 없습니다.    var url = "<%=webcode.PublicMethod.url.HttpAndPoint%>/call/ChatSubmitJson?callback=?";    var data = { wrEditor: encodeURI(showdData,"utf-8"), id: "<%=ViewData["id"]%>" };     $.ajaxSetup({ scriptCharset: "utf-8" , contentType: "application/json; charset=utf-8"});$.getJSON(url, data, function(backdata) {//alert(backdata.wrEditor);parent.olEditor.document.charset="utf-8";parent.olEditor.document.body.innerHTML =""+backdata.wrEditor+"
";});
 
 
 public ContentResult ChatSubmitJson()

        {

            int enterpriseId = Convert.ToInt32(Request["id"] ?? "0");

            var enterprise = _enter.GetEnterprise(enterpriseId);

            string callback = Request.QueryString.Get("callback");

            string question = HttpUtility.UrlDecode(Request["wrEditor"], Encoding.UTF8);

            string content = string.Empty;

            string shootKeywords = string.Empty;

            string voiceUrl = string.Empty;

            ViewData["Name"] = _enter.GetEnterprise(enterpriseId).FullCompanyName;

            var list = new List<MessageModel>();//messageModel

            list.Add(new MessageModel

                         {

                             ClientId = _guid + enterpriseId,

                             Speaker = " ",

                             EnterpriseId = enterpriseId,

                             Content = question,

                             CreateTime = DateTime.Now,

                             Extend = " "

            });

            List<AnswerModel> answerList = _manager.GetAnswer(question, enterpriseId, _guid + "&" + enterpriseId, ref shootKeywords, ref voiceUrl);

            foreach (AnswerModel model in answerList)//        MessageModel

            {

                list.Add(_manager.NewSendMessage(string.Format("{0}    ", enterprise.ShortCompanyName), model.Answer, _guid + "&" + enterpriseId));

            }

            foreach (MessageModel message in list)//        

            {

                string color = (message.Extend == " ") ? "#000" : "blue";

                content += string.Format("<font color=\"" + color + "\">{0}  {1}<br />{2}</font><br /><br />", message.Speaker, message.CreateTime.ToString("HH:mm:ss"), message.Content);

            }

            var vUrl = string.Format("{0}{1}", ConfigFile.VoiceFileUrl, voiceUrl);

            string backjsondata = "({'id':'" + enterpriseId + "','wrEditor':'" + content + "','vid':'" + vUrl + "'})";

            string mybackdata = callback + backjsondata;

            return Content(mybackdata);

        }

좋은 웹페이지 즐겨찾기