I am solving a challenge where I have to click on a link "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345" get the next nothing number from that page, and insert it at the end of the query string, probably, until there are no more "nothings" left and I have solved it.
I have tried making an Ajax request and getting the data of the next number to use in my next query stting, however oddly I get a syntax error. When I click on the error though, the data I am looking for is shown in the error "and the next nothing is 44827." Here is my code
$(document).ready(function(){
$.getJSON("http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345&callback=?",
function(data){
console.log(data);
}
)
})
How can I do this without getting an error so I can repeatedly get the next "nothing"? And why am I getting a syntax error?
If this is the wrong way to go about solving this, I would appreciate any direction on the correct way to approach this.
Thank.