开发者

Ajax Requests in Firefox 5, works in Webkit

开发者 https://www.devze.com 2023-03-16 21:43 出处:网络
Here is the first simple javascript ajax request that I tried that did not work. var obj = {}; o开发者_JAVA百科bj.action = \"clubbar\";

Here is the first simple javascript ajax request that I tried that did not work.

var obj = {};
o开发者_JAVA百科bj.action = "clubbar";
$.post("/ajax/lojack", obj, function(data){ 
var real = JSON.parse(data);
});

When I do the json parse function i get this error

uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://localhost:8888//admin/newclubbar.jsp :: <TOP_LEVEL> :: line 381" data: no]

When I tried to do it without jquery, I get the same error:

var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    var data = JSON.parse(xmlhttp.responseText);
    }
  }
xmlhttp.open("GET","/ajax/lojack?action=clubbar",true);
xmlhttp.setRequestHeader("Content-type", "text/html");
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(null); I also tried xml.http.send(""); 

I could post the actual JSON but Webkit has no problem with it


Sincerest apologies..... a.setAttribute('going_' + nbhood.id); You were right about the line number setAttribute has two parameters...duhhhhhhh. I was tired.

0

精彩评论

暂无评论...
验证码 换一张
取 消