skip to Main Content

jquery ajax post with location.href in data is not working

What is preventing type POST from getting the expected result if using location.href (or window.location.href) as data? This code is not working (it returns nothing): $.ajax({ type: "POST", url: 'page.asp', data: {'q': location.href}, success: function(short_link,status){ console.log('short_link = '+short_link); console.log('status =…

VIEW QUESTION

ajax function is not working in my JavaScript function function skip the ajax – Jquery ajax

return without executing the ajax function function weekData(){ var weekCount={}; $.ajax({ url:"http://localhost:8080/getWeeeks", headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, type:"GET", dataType:"json", data:{}, success:function(data){ for (var i = 0; i < data.length; i++) { weekCount[i]=data[i]; } debugger return weekCount; }, }); return weekCount…

VIEW QUESTION
Back To Top
Search