Javascript-tag-pop is displayed when you place the cursor over the tag repeatedly, but ajax is used only once.

Source: Internet
Author: User
When you click on the segmentfault tag, the details of the TAG content will be displayed in the pop-up box. However, I found that the TAG content is repeatedly swiped multiple times on the console, and ajax only initiates the request for the first time, which of the following technologies is used to display the TAG content in the segmentfault label dialog box? However, I found that the ajax request was initiated only for the first time after repeated sliding on the console, what technologies are used here?

Reply content:

When you click on the segmentfault tag, the detailed TAG content is displayed in the pop-up box. However, I found that the TAG content is repeatedly swiped multiple times on the console. ajax only initiates the request for the first time. What technology is used?

After the first request, enter the content in the DOM and then cancel it.hoverThe AJAX listening part of the event (or mark the content that has been filled with the attribute on the DOM.

I guess,

var api = {};$ajaxForm.on('submit',function(event) {    event.preventDefault();    $response.empty();    var search = $('#title').val();    if (search == '') {        return;    }    $response.addClass('loading');    if (!api[search]) {        api[search] = $.ajax({            url: 'http://book.learningjquery.com/api/',            dataType: 'jsonp',            data: {                title: search            },            timeout: 15000        });    }    api[search].done(response).fail(function() {        $response.html(failed);    }).always(function() {        $response.removeClass('loading');    });});

(The Code comes from the basic jQuery tutorial.13.3.2 cache response)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.