Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8009971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:36:00+00:00 2026-06-04T18:36:00+00:00

if i run this, i get the sending messages but received message doesn’t show

  • 0

if i run this, i get the “sending” messages but “received” message doesn’t show up. why? the error message is No Transport in the fail and error block.

html:

<ul>
    <li><a href="http://www.hotmail.com">hotmail.com</a></li>
    <li><a href="http://www.google.com">google.com</a></li>
</ul>

js:

<script type="text/javascript">
    $(document).ready(function () {
        $("a").each(function (index) {
            var sUrl = 'http://tinyurl.com/api-create.php?url=' + $(this).attr('href')
            alert('sending: ' + sUrl);
            $.ajax({
                url: sUrl,
                crossDomain: true
            }).fail(function (data) {
                alert('failed: ' + data.statusText);
            }).error(function (data) {
                alert('error: ' + data.statusText);
            }).done(function (data) {
                alert('received: ' + sUrl);
            });
        });
    });
</script>

edit: the accepted answer uses $.getJSON which calls $.ajax internally. for those who may be interested in low level $.ajax, here you go.

$('a').each(function (index) {
    var app = 'http://json-tinyurl.appspot.com/';
    var sUrl = app + '?url=' + $(this).attr('href') + '&callback=?';
    $.ajax({
        url: sUrl,
        dataType: 'json',
        success: function (data) {
            alert('ajax:' + data.tinyurl);
        },
        error: function (jqXHR, textStatus, errorThrown) {
            alert("jqXHR=" + jqXHR.responseText + "\ntextStatus=" + textStatus + "\nerrorThrown=" + errorThrown);
        }
    });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:36:01+00:00Added an answer on June 4, 2026 at 6:36 pm

    You are running into a problem because you are making a cross domain call and not using jsonp. See the answer here for a solution to your tinyurl generation problem:

    Create TinyURL via Jquery Ajax call

    Using that as reference, here is your fixed code:

    $(document).ready(function() {
        $("a").each(function(index) {
            var sUrl = $(this).attr('href');
            $.getJSON("http://json-tinyurl.appspot.com/?&callback=?", {
                url: sUrl
            }, function(data) {
                alert(data.tinyurl);
            });
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error FB is not defined when i try to run this
If I run this code on IE8 or lower, I get this error: Object
I get this error when I run a django app ( dpaste ) Template
I get this error when I run the application Incorrect syntax near 12 ,
I get this error when I run gradle test : Caused by: org.gradle.api.GradleException: Could
I get this build error when I build my iPhone project to run on
I can run the APNS successfully on server. I get this message: Fri, 03
I run this piece of code on Visual C++ 2010 char c[10]; cin.get(&c[0],5); cin.get(&c[2],4);
I was wondering how to get this to run. In my application I have
When I try to run this code, I get incorrect maximums and minimums. Could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.