dojo ajax content,javascript - SyntaxError: Unexpected Token <(...) - dojo/ajax - Stack Overflow

I'm using the following AJAX in my project

var _getWeatherInfo = function(ntown){

//Debugging

console.log("Before dojo.xhrget");

//dojo ajax request used to call the PHP file and retrieve the towns data

dojo.xhrGet({

handleAs: "json",

timeout: 5000,

//php file URL (location)

url: "PHP/weather.php?ntown=" + ntown,

load: function(results) {

//send the results to the function _refreshWeatherList

_refreshWeatherList(results);

}

});

//Debugging

console.log("After dojo.xhrget");

}

In order to retrieve weather data for cities/towns. However, its been a while since i worked on this project and i'm having trouble understanding why this is no longer working (it was working last time i ran this project).

In the browser console im getting the following error:

SyntaxError: Unexpected token <

at Object.b.fromJson (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:227:426)

at Object.b._contentHandlers.b.contentHandlers.json (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:185:216)

at t (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:189:392)

at c (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:75:221)

at d (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:75:10)

at resolve.callback (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:76:350)

at http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:192:378

at k (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:196:406)

at n (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:196:332)

at resolve (http://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js:198:406)y @ dojo.js.uncompressed.js:14021(anonymous function) @ dojo.js.uncompressed.js:13981c @ dojo.js.uncompressed.js:4579d @ dojo.js.uncompressed.js:4560reject.errback @ dojo.js.uncompressed.js:4655c @ dojo.js.uncompressed.js:4594d @ dojo.js.uncompressed.js:4560reject.errback @ dojo.js.uncompressed.js:4655c @ dojo.js.uncompressed.js:4590d @ dojo.js.uncompressed.js:4560resolve.callback @ dojo.js.uncompressed.js:4640(anonymous function) @ dojo.js.uncompressed.js:14208k @ dojo.js.uncompressed.js:14488n @ dojo.js.uncompressed.js:14479resolve @ dojo.js.uncompressed.js:14643a @ dojo.js.uncompressed.js:14532k @ dojo.js.uncompressed.js:14503n @ dojo.js.uncompressed.js:14479resolve @ dojo.js.uncompressed.js:14643a @ dojo.js.uncompressed.js:14532k @ dojo.js.uncompressed.js:14509n @ dojo.js.uncompressed.js:14479resolve @ dojo.js.uncompressed.js:14643a @ dojo.js.uncompressed.js:14532k @ dojo.js.uncompressed.js:14503n @ dojo.js.uncompressed.js:14479resolve @ dojo.js.uncompressed.js:14643r @ dojo.js.uncompressed.js:11883f @ dojo.js.uncompressed.js:11909

I'm including dojo using:

xhr Response:

"

↵↵( ! ) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in E:\Program Files (x86)\wamp\www\Weather-Widget-App-master\PHP\configHome.php on line 6↵Call Stack↵#TimeMemoryFunctionLocation↵10.0004244528{main}( )..\weather.php:0↵20.0006248360include( 'E:\Program Files (x86)\wamp\www\Weather-Widget-App-master\PHP\configHome.php' )..\weather.php:2↵30.0006248936http://www.php.net/function.mysql-connect' target='_new'>mysql_connect↵( )..\configHome.php:6↵↵

↵↵( ! ) Warning: mysql_select_db() expects parameter 1 to be string, resource given in E:\Program Files (x86)\wamp\www\Weather-Widget-App-master\PHP\configHome.php on line 9↵Call Stack↵#TimeMemoryFunctionLocation↵10.0004244528{main}( )..\weather.php:0↵20.0006248360include( 'E:\Program Files (x86)\wamp\www\Weather-Widget-App-master\PHP\configHome.php' )..\weather.php:2↵30.0300257280http://www.php.net/function.mysql-select-db' target='_new'>mysql_select_db↵( )..\configHome.php:9↵↵Error selecting specified database on mysql server: "

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值