jquery Treeview在google浏览器下不能正常显示问题
我的树结构在ie和ff下都能显示 可是在google浏览器下不能显示树结构报错是
Failed to load resource 但是不提示原因 在google下跟踪调试过了数据能够返回 就是google收不到
请教各位大侠
下面是代码
js代码: 给树控件赋值
$(document).ready(function(){
$("#treeV1").treeview({
url: "anyTree.ashx?type=1&sensor=false&output=json&callback=?"
});
});
jquery.treeview.async.js代码:
;(function($) {
function load(settings, root, child, container) {
$.getJSON(settings.url, {root: root}, function(response) {
function createNode(parent) {
// alert("aaa");
var current = $("<li/>").attr("id", this.id || "").html("<span>" + this.text + "</span>").appendTo(parent);
if (this.noChildren) {
current.find("span").attr("style","cursor:pointer").bind("click",function(e){var curid=$(this).parent().attr("id");SFLC3(curid,1,0);});
}
else
{
current.find("span").attr("style","cursor:pointer").bind("click",function(e){var curid=$(this).parent().attr("id");});
}
if (this.classes) {
current.children("span").addClass(this.classes);
}
if (this.expanded) {
current.addClass("open");
}
if (this.hasChildren || this.children && this.children.length) {
var branch = $("<ul/>").appendTo(current);
if (this.hasChildren) {
current.addClass("hasChildren");
createNode.call({
text:"placeholder",
id:"placeholder",
children:[]
}, branch);
}
if (this.children && this.children.length) {
$.each(this.children, createNode, [branch])
}
}
}
$.each(response, createNode, [child]);
$(container).treeview({add: child});
});
}
var proxied = $.fn.treeview;
$.fn.treeview = function(settings) {
if (!settings.url) {
return proxied.apply(this, arguments);
}
var container = this;
load(settings, "source", this, container);
var userToggle = settings.toggle;
return proxied.call(this, $.extend({}, settings, {
collapsed: true,
toggle: function() {
var $this = $(this);
if ($this.hasClass("hasChildren")) {
var childList = $this.removeClass("hasChildren").find("ul");
childList.empty();
load(settings, this.id, childList, container);
}
if (userToggle) {
userToggle.apply(this, arguments);
}
}
}));
};
anytree.ashx代码: 跟踪调试过了数据能够返回 就是google收不到
public void ProcessRequest(HttpContext context)
{
context.Response.Clear();
context.Response.Charset = "utf-8";
context.Response.Buffer = true;
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
context.Response.ContentType = "text/json";
string strtype = context.Request.QueryString["type"];
string code = "000";
if (context.Request.QueryString["root"] != null)
{
if (!context.Request.QueryString["root"].Equals("source"))
{
code = context.Request.QueryString["root"];//不是根节点,存储当前节点
}
}
string strTableContent = "";
strTableContent = GetJsonStr(code, strtype);
context.Response.Write(strTableContent);
context.Response.Flush();
context.Response.Close();
context.Response.End();
}