How to alert a Prompt box with a input box

How to alert a Prompt box with a input box::

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    alert("I am an alert box!");
}
</script>

 

source:  https://www.w3schools.com/js/js_popup.asp

Please follow and like us:
0

Check for Ajax request in CodeIgniter

Check for Ajax request in CodeIgniter::

To check Ajax Request in CodeIgniter, we will use CodeIgniter Output Class Method class is_ajax_request() , this function checks if the HTTP_X_REQUESTED_WITH server header has been set, if set response will be true otherwise false means it will returns a boolean response

You can use $this->input->is_ajax_request() from the input class.

if (!$this->input->is_ajax_request()) {
   exit('No direct script access allowed');
}else{
   echo "ajax request";
}

source:
https://codeigniter.com/user_guide/libraries/input.html

Please follow and like us:
0