JQUERY AJAX output going wrong with Alert(json.result)


I have some javascript and I have a simple output question.

The code that I am using uses:

alert(json.result) to provide the output. The problem is this is displayed in a separate dialogue box (small window) - I want the results on my website web page.

Should I be using something different to the “alert” code? Is the a way to pass JavaScript output to a PHP variable?



You can add HTML content to an element in your page with innerHTML

document.querySelector('#content').innerHTML = json.result;

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.