首頁  >  文章  >  web前端  >  js跨網域存取範例(客戶端/服務端)_javascript技巧

js跨網域存取範例(客戶端/服務端)_javascript技巧

WBOY
WBOY原創
2016-05-16 16:47:501634瀏覽
複製程式碼 程式碼如下:




服務端H.ashx

複製程式碼複製程式碼


複製程式碼


程式碼如下:




using System;
using System.Web;

public class H : IHttpHandler {

public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";

string result = context.Request.QuString. "jsoncallback"] "({"name":"測試編號為","openid":"123456789"})";

context.Response.Clear();
context.Response.Write (result);
context.Response.End();


}

public bool IsReusable {
get { return falsese }; } }
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn