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

  • SEARCH
  • Home
  • 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 6472961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:24:31+00:00 2026-05-25T06:24:31+00:00

Does anyone have a clue to how bit.ly is replacing the textarea as soon

  • 0

Does anyone have a clue to how bit.ly is replacing the textarea as soon as you finish typing the link?

  • 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-05-25T06:24:32+00:00Added an answer on May 25, 2026 at 6:24 am

    I think that the OP is asking how bit.ly converts the long URL into a shorter URL without reloading the page. This would be done with an AJAX call to a web page, that has a script running on it.

    Here is my attempt getting a similar effect on a form submit, I don’t know what aspect is what you are most interested in.

    <script type="text/javascript">
    document.getElementById('formElement').onsubmit = "return requestURL();";
    function requestURL() {
        var data = document.getElementById('formInputData').value; // get value from <input type="text" id="formInputData />
        if (window.XMLHttpRequest) {
            var request=new XMLHttpRequest(); // code for IE7+, Firefox, Chrome, Opera, Safari
        }
        else {
            var request=new ActiveXObject("Microsoft.XMLHTTP"); // code for IE6, IE5
        }
        request.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            // if the request worked, output the data the server returned (PHP, .net, etc.)
            document.getElementById('serveroutput').innerHTML = result.responseText;
        }
        request.open("GET", "serverscript.ext?data="+data, "true"); // Setup the server request
        request.send(); // Send the request to the server
        return false; // Stops the form from submitting normally
    }
    </script>
    

    This example has no security, style, or other special stuff, but might give a better idea.
    JSON or similar methods are probably used to get data back to JavaScript, which then styles and displays the data. I can’t give specifics of what bit.ly uses, but this is the idea I would use if I tried a similar JavaScript solution.

    How did I answer the question? Did I answer something completely different? Should I expand on the answer? Do I ask too many questions? (Yes to the last question)


    In response to a comment upon pressing the space bar, that functionality can be added to the above code with the following function.

    <script type="text/javascript">
        document.getElementById('formInputData').onkeypress = function() {
            if(document.getElementById('formInputData').value.split('')[-1] === " ") {
                document.getElementById('formInputData').value = document.getElementById('formInputData').value.substring(0, str.length - 1);
                requestURL();
            }
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how secure Wordpress is? I have no clue how to define
Does anyone have any clue as to what this might mean? (ClCompile target) ->
Does anyone have any clue why this doesn't work as expected. If i use
Does anyone have a clue what this SSRS error means? the only thingi found
Does anyone have a clue as to why this returns a null descriptor in
uitest.ascx usercontrol events do not fire, does anyone have a clue about it? business.Pages.Page
Does anyone have a clue how to use this? The documentation as usual is
Does anyone have any clue why a code behind function would work in Firefox
Does anyone have any recommendations of tools that can be of assistance with moving
Does anyone have a definitive answer to whether Sql Server Management Objects is compatible

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.