gokou340
gokou340

Reputation: 1

Script error: "Unable to get value of the property 'split': Object is null or undefined

I searched around, and couldn't find an answer to my question. I'm very new at coding, and at work, we have an application that current names that are logged in, and what they are doing.

Recently, they have changed from jquery 1.4.1 to jquery 1.8.3. Ever since then, I cannot get the results to process correctly, because of the following error; "Unable to get value of the property 'split': Object is null or undefined"

I have the code setup to grab the results and split them;

function processAgents(xData, status) {
var avail    = xData.responseText.split("|")[0];
var acw      = xData.responseText.split("|")[1];
var total    = xData.responseText.split("|")[2];
var breaks    = xData.responseText.split("|")[3];
var pending  = xData.responseText.split("|")[4];

The application is setup to open as an HTA file which opens up the PHP script.

Any help would be appreciated, please let me know if I left anything out!

Thanks!

EDIT 1

I did some more investigating, and it looks like I'm not getting data from my process request. This is how it is currently setup

function updateAgents() {
var ts1 = new Date().getTime();
$.ajax({
      url: "http://SERVER/AgentSrc.php?x=" + ts1,
      complete: processAgents

I'm not sure if this is processing correctly since they went to jquery 1.8.3.

EDIT 2 So after looking into it more, it doesn't appear that the script is getting the data from the server, even though I have access. If I make a local file and put the information in it, it will pull the information and split it, but if I point to the path of the file on the server, it won't get the information. But the strange thing is, if I run it using jquery 1.4.1, it pulls the data fine, but can't display it. But with 1.8.3, it doesn't allow me to pull it from the server.

thanks again!

Upvotes: 0

Views: 6113

Answers (2)

Christophe
Christophe

Reputation: 28174

Here is a possible explanation: in earlier versions of jQuery, ajax calls returned an xmlHttpRequest (XHR) object. Recent versions return a promise (jqXHR) instead.

See this page for more details.

Upvotes: 1

Hogan
Hogan

Reputation: 70528

This will give some clarity

xData.responseText.toString().split("|")[0];

(split is part of string not jQuery)

Upvotes: 1

Related Questions