ajax jquery simple get request

0 votes

I am making this simple get request using jquery ajax:

$.ajax({
    url: "https://app.asana.com/-/api/0.1/workspaces/",
    type: 'GET',
    success: function(res) {
        console.log(res);
        alert(res);
    }
});

It's returning an empty string as a result. If i go to this link in my browser, i get:

{"status":401,"error":"Not Authorized"}

which is the expected result. So why isn't it working using ajax? thanks!

Jun 30, 2022 in Web Development by gaurav
• 23,260 points
499 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

Problems with JQuery $.ajax request to random.org api

You need to stringify the data yourself ...READ MORE

answered Aug 1, 2022 in Web Development by rajatha
• 7,680 points
1,074 views
0 votes
1 answer

External API GET() request using jQuery

Replace: $.ajax({ type: "GET", url: "http://www.imdbapi.com/", cache: false, data: dataString, success: function(html){ //$("#more").after(html); alert("Success!"); } }); With $.getJSON('http://www.imdbapi.com/?' + ...READ MORE

answered Aug 5, 2022 in Web Development by rajatha
• 7,680 points
2,117 views
0 votes
1 answer

How can you send an AJAX request using jQuery?

The $.ajax() method will send an AJAX ...READ MORE

answered Nov 13 in Web Development by kavya
53 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,527 views
0 votes
1 answer

How can I create a simple page vertical scroll bar without using jQuery?

Surprisingly, there is not a great, simple ...READ MORE

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

Get checkbox value in jQuery

To get the value of the Value ...READ MORE

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

jQuery AJAX submit form

There is a simple input mentioned below ...READ MORE

answered Feb 8, 2022 in Java by Soham
• 9,710 points
1,736 views
0 votes
0 answers

How can I upload files asynchronously with jQuery?

I would like to upload a file ...READ MORE

Jun 10, 2022 in JQuery by gaurav
• 23,260 points
662 views
0 votes
1 answer

Abort Ajax requests using jQuery

Instead of aborting, you can choose to ...READ MORE

answered Jun 16, 2022 in JQuery by rajatha
• 7,680 points
784 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,159 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