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, 2022 in Web Development by gaurav
• 23,260 points
365 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, 2022 in Web Development by rajatha
• 7,680 points
1,713 views
0 votes
1 answer

Why use jQuery on() instead of click()

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

answered Jun 27, 2022 in Web Development by rajatha
• 7,680 points
435 views
0 votes
1 answer

Why use jQuery on() instead of click()

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

answered Aug 1, 2022 in Web Development by rajatha
• 7,680 points
1,336 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,840 points
7,508 views
0 votes
1 answer

Pure JS equivalent of Jquery eq()

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

answered Jun 23, 2022 in Web Development by rajatha
• 7,680 points
1,395 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, 2022 in Web Development by rajatha
• 7,680 points
3,336 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, 2022 in PHP by narikkadan
• 63,600 points
8,112 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, 2022 in Web Development by rajatha
• 7,680 points
6,988 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,840 points
15,710 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,840 points
23,295 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP