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 in Web Development by gaurav
• 17,000 points
7 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 in Web Development by rajatha
• 7,040 points
13 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 3 days ago in Web Development by rajatha
• 7,040 points
4 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,740 points
5,588 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 in Web Development by rajatha
• 7,040 points
11 views
0 votes
1 answer

Get checkbox value in jQuery

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

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

jQuery get value of select onChange

Try this- $('select').on('change', function() { alert( this.value ...READ MORE

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

jQuery AJAX submit form

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

answered Feb 8 in Java by Soham
• 8,740 points
238 views
0 votes
0 answers

How can I upload files asynchronously with jQuery?

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

Jun 10 in JQuery by gaurav
• 17,000 points
34 views
0 votes
1 answer

Abort Ajax requests using jQuery

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

answered Jun 16 in JQuery by rajatha
• 7,040 points
31 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
• 11,280 points
102 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