I’m tring to redirect to external site and get the response.
- nothing happend see code
- i want to emmbade the site in the page (that works) and get to response for that.
so its like 2 questions i prefer to emmbade the external page in my page and be able to read the response of that site!
i think im missing something
the code i tried:
var base_url = ‘תשלום מאובטח - ידידי מפעל השליחות ער - באמצעות יעד סליקה’;
var new_url =base_url + “ClientName=” + $w(“#input1”).value +
“&ClientLName=” + $w(“#input2”).value +
“&cell=” + $w(“#input4”).value +
“&email=” + $w(“#input3”).value +
“&Amount=” + $w(“#inBox1”).value + “&Info=%D7%91%D7%99%D7%AA%20%D7%97%D7%91%22%D7%93%20%D7%A7%D7%A1%D7%A8%20%D7%93%D7%99%D7%95%D7%95%D7%99&tmp=8” +
“&Coin=”+ $w(“#dropdown2”).value + “&PageLang=HEB&Postpone=False&” +
“Tash=” + $w(“#dropdown1”).value + “&FixTash=True&SendHesh=True”;
var obj;
console.log(new_url); //the url is correct
//try to display the site but nothing happend+++
fetch(new_url, {method: ‘get’})
.then(response => response.json())
.then(json => obj = JSON.parse(json));
console.log(obj);
// $w(“#html1”).src = new_url; // embadeing the external site is show!!
[//wixLocation.to(new_url);](correct
//wixLocation.to(new_url)
//tried also this but nothing happend
}
You have two choices with your options from YaadPay.
If you are embedding the html code into an html iframe on your page then you will need to add the moving to a new page within your existing html code.
As you’re using YaadPay, it is code from a third party provider which Wix will not provide support for
https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site
Wix cannot provide support for external codes that were not created or tested with Wix.
If you are experiencing an issue with your code snippet, please contact the provider directly.
So you will need to reach out to their own support to get help with adding this to their own html code that they supplied you with.
Otherwise, you will have to look into using their own API and either using Wix Fetch or Wix HTTP Functions to expose your site.
https://www.wix.com/corvid/reference/wix-fetch.html
https://support.wix.com/en/article/corvid-accessing-third-party-services-with-the-fetch-api
https://www.wix.com/corvid/reference/wix-http-functions.html
https://support.wix.com/en/article/corvid-exposing-a-site-api-with-http-functions
Wix Corvid Example.
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-myapi-and-myapiclient
Finally, you can use Wix HTML Component to pass data to a html component from your page or to a page from an html component as shown here.
https://support.wix.com/en/article/corvid-working-with-the-html-element
https://www.wix.com/corvid/reference/$w.HtmlComponent.html
As for using the src of the html component then make sure that you are using it correctly.
https://www.wix.com/corvid/reference/$w.HtmlComponent.html#src
Set the displayed website
$w("#myHtmlComponent").src = "https://en.wikipedia.org/wiki/HTTPS";