jquery ajax call metho instead of method

0 votes

I have a script.js that uses jQuery's ajax function to query string to a php file, it works as expected BUT i find it odd that i must use the "metho" sintax instead of the "method", look at this,

this works

script.js

    $.ajax({
    url: 'php/printers.php',
    metho: 'POST',
    data: {
        data: c,
        orderby: d,
        },
    success: function(output) {

        $('.results').html(output);

        var tbody = document.getElementsByClassName('results');
        var rows = tbody[0].getElementsByTagName('tr');     

        ajax.applyClass(rows);  
    }
});

this doesn't

    $.ajax({
    url: 'php/printers.php',
    method: 'POST',
    data: {
        data: c,
        orderby: d,
        },
    success: function(output) {

        $('.results').html(output);

        var tbody = document.getElementsByClassName('results');
        var rows = tbody[0].getElementsByTagName('tr');     

        ajax.applyClass(rows);  
    }
});

i'm preplexed that i must use the "metho" instead "method" :O i don't even know how that happened, though it was a typo??

Aug 18 in Web Development by gaurav
• 18,960 points
23 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Web Development

0 votes
1 answer

Loading gif in jQuery ajax call is not showing

Create a div with your image. Make it ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,440 points
186 views
0 votes
1 answer

Why use jQuery on() instead of click()

The . on() method attaches event handlers to ...READ MORE

answered Jun 27 in Web Development by rajatha
• 7,440 points
25 views
0 votes
1 answer

Why use jQuery on() instead of click()

on() differs from . click() in that it ...READ MORE

answered Aug 1 in Web Development by rajatha
• 7,440 points
30 views
0 votes
1 answer

How to download a file by jQuery.Ajax?

Hello @kartik, You don't need to do this ...READ MORE

answered Sep 18, 2020 in Web Development by Niroj
• 82,780 points
5,728 views
0 votes
1 answer

Pure JS equivalent of Jquery eq()

To get the element index in the ...READ MORE

answered Jun 23 in Web Development by rajatha
• 7,440 points
81 views
0 votes
1 answer

$("#select option:second").val() jquery - keep select second value of select box option

Yes, you want the special jQuery eq() selector. ...READ MORE

answered Jun 22 in Web Development by rajatha
• 7,440 points
27 views
0 votes
0 answers

Fetch data from database in php through AJAX,

The index.php  I created a connection with the ...READ MORE

Jun 16 in PHP by narikkadan
• 19,680 points
650 views
0 votes
1 answer

How to set selected value of jQuery Select2?

To set selected value of jQuery Select2 ...READ MORE

answered Aug 5 in Web Development by rajatha
• 7,440 points
56 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,780 points
9,339 views
0 votes
1 answer

Uncaught Error: Bootstrap's JavaScript requires jQuery

Hello @kartik, You have provided wrong order for ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,780 points
16,534 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP