TypeError Ajax is not a function
Hi,
I'm quite blur in which part is causing this error (TypeError $.ajax is not a function) Already try almost every solution i found on the internet.
- <script src="https://code.jquery.com/jquery-2.2.4.min.js" type="text/javascript"></script>
- <script>
- $(document).ready(function() {
- console.log($.ajax);
- });
- </script>
- <script>
- //listing charity in dropdown list
- $.ajax({
- type: 'GET',
- url: 'http://ayambrand-com-my-v1.cloudaccess.host/index.php?option=com_echarity&format=raw&task=api.get_charities',
- data: { get_param: 'value' },
- dataType: 'json',
- success: function (data) {
- console.log(data);
- $.each(data, function(index, element) {
- $('#list').append($('<option>', {
- text: element.charity_name,
- value : element.id
- }));
- });
- //end of success loop
- }
- });
- //get dropdown list charity selection
- function getcharity($charityID){
- $.ajax({
- url : "http://ayambrand-com-my-v1.cloudaccess.host/index.php?option=com_echarity&format=raw&task=api.get_charity&charity_id="+$charityID,
- cache : false,
- beforeSend : function (){
- //Show a message
- alert("On the way to sending request!!!");
- },
- complete : function($response, $status){
- if ($status != "error" && $status != "timeout") {
- $('#contents').html($response.responseText);
- }
- },
- error : function ($responseObj){
- alert("Something went wrong while processing your request.\n\nError => " + $responseObj.responseText);
- }
- });
- }
- //end get dropdown list charity selection
- </script>
- <script>
- </script>
- <?php
- //echo $charity_id;
- ?>
- <div>
- <form>
- <table class="table-a">
- <tr>
- <td>
- <select id="list" onChange="getcharity(this.value)">
- </select>
- </td>
- </tr>
- </table>
- <table class="table-b">
- <tr>
- <td>
- <span id="contents"></span>
- </td>
- </tr>
- </table>
- </form>
- </div>
-