In my current script, I am loading external content using the following code:
<script type="text/javascript">
var http_request = false;
function makePOSTRequest(url, parameters) {
// Code for making POST request
}
function alertContents() {
// Function to handle response from server
}
function get(obj) {
// Function to send POST request
}
</script>
This is the dropdown menu that triggers the content retrieval:
<select name="port_post" id="port-post" onchange="get(this.parentNode);">
<option value="1">Select one...</option>
<option value="2">Pear</option>
<option value="3">Pineapple</option>
</select>
Additionally, here is the div where the retrieved content is displayed:
<div id="opciones">Default content</div>
I am seeking guidance on how to stop the AJAX loading when "Select one..." is chosen in the dropdown. Specifically, I want to revert back to the default content once this option is selected.