Using js to pass parameters through url to transfer data from one page to another _ javascript skills

Source: Internet
Author: User
If it is uploaded to a new page, which language is your website developed to directly obtain the data using get or post, and then output the data to this layer using js to transfer data from one page to another page layer?

If it is uploaded to a new page, your website can be directly obtained using get or post based on the language development, and then output to this layer.

Passing parameters through url

If the link on the HTML page is sent to the new page, the link will be location.hrefw.'a.html? Id1_100'then the js on the a.html page

Script document. getElementById ("s"). innerHTML = window. location. split ('? ') [1]; script

If you want to implement AJAX to Transfer Parameters on page a to page B and display the result of parameters executed on page B at the layer of page a, you can use AJAX.

This is written too much. It's for JQUERY.

$ ("# A"). load ("B .html? Id = 100 "); // or $. get (" B .html? Id = 100 ", function (data) {$ (" # a ").html (data );})

There is also the POST method, which will not be listed here

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.