JavaScript-Questions about data acquired by Ajax

Source: Internet
Author: User

In the a.html has UL, now UL has three Li, I now is every click a Li through Ajax to get the corresponding data,
Then there are three a tags in b.html, q How can I achieve in b.html click a tag to jump to the corresponding Li in a.html and get the corresponding data???

Reply content:

In the a.html has UL, now UL has three Li, I now is every click a Li through Ajax to get the corresponding data,
Then there are three a tags in b.html, q How can I achieve in b.html click a tag to jump to the corresponding Li in a.html and get the corresponding data???

The following is a pseudo-code for reference only

B.html

跳转到LI_A并取得数据

A.html

  • li_a
  • li_b
  • li_c
  • $('.myli').click(function () { loadData($(this).index());});// 进入页面判断参数,然后点击对应LI标签window.onload = function () { var index = getQuery('li') $('.myli').get(index).click();}

    这个demo你看下:前台:    
      
                                                   
    后台:
  • 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.