I'm at witts end. I originally got this working using a regex php file and returning the data via ajax with no problems. But each time there was a link on the page it requests that php file, and with many links it returned many iterations of the page and many requests it just isn't fantastic.

At the moment I'm just looking at any kind of data to be displayed in the console. Any ideas?

Cheers.

chris_upjohn
—
2012-12-11T06:19:46Z —
#2

Currently you're logging the iconaddy variable which will always return null, instead what you want to be doing is logging the data parameter been set in your anonymous function for success. To set the variable you can simply assign the value of data to the iconaddy variable, you will have to make one small change when doing that though which is to add the async setting in your ajax request and set the value to false which will make the request synchronous which means the code following the ajax request will only get triggered upon the request been completed first.

Currently you're logging the iconaddy variable which will always return null, instead what you want to be doing is logging the data parameter been set in your anonymous function for success. To set the variable you can simply assign the value of data to the iconaddy variable, you will have to make one small change when doing that though which is to add the async setting in your ajax request and set the value to false which will make the request synchronous which means the code following the ajax request will only get triggered upon the request been completed first.

Thanks for your response chris. I have adjusted my code to match was you suggested, but it appears I'm still having issues. Here's my code and I have attached a screenshot of the response. The blue line represents a particular line from the response I'm after.