I developed Visualforce page and I want to redirect to external website using apex:actionFunction, every time I execute actionFuncton I got the following error
Access to XMLHttpRequest at 'https://icom.yaad.net/' (redirected from 'https://my-dev--new--c.cs102.visual.force.com/apex/IdentificationBeforeRegistrationPage') from origin 'https://my-dev--new--c.cs102.visual.force.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I tried to add
https://icom.yaad.net/ this website to CORS settings under setup, but it doesn't work, any idea how I can solve the issue?
url = 'https://icom.yaad.net/p?firstName=test'; PageReference target = new PageReference(url); target.setRedirect(true); // This is a permanent redirection target.setRedirectCode(301); return target;