JS cross-domain value value

Source: Internet
Author: User


Tool: Require.js


cross-domain pass-through values --

1. Form form

    var action =  submitted url;    //Create a form to submit data across domains      var form = document.createelement ("form");     var iframe  = document.createelement ("iframe");    iframe.id =  "Id_iframe";     iframe.name =  "Id_iframe";     iframe.style.display =   "None";     document.body.appendchild (form);     Document.body.appendChild (IFRAME);     document.clear (iframe);     var   parameter = document.createelement ("input");     parameter .type =  "hidden";     form.appendchild (parameter);     parameter. value= parameter value;     parameter. name= Parameter name;    form.action = action;    form.method =  " Post ";    form.target =  "Id_iframe";     form.submit (); 

2, Require.js

var url = "http://The URL you want to pass" + "parameter =xxxxx"; Require ([Url],function (data) {});

Cross-domain Fetch value--require.js

var url = "http://You want to fetch the URL of the return value" + "? Parameter =xxxxx"; require ([url], function (data) {alert (return value)///Here directly write the name of the return value, not data.});


JS cross-domain value value

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.