Created
August 21, 2020 08:23
-
-
Save Mutale85/a4accd7af45236433f46c85aba586bdc to your computer and use it in GitHub Desktop.
Having issues with CORS?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is how i manage to solve my CORS | |
$.ajax({ | |
type: 'GET', | |
url: 'https://example.com/filename.php', | |
data:{postname:postname, postname2:postname2}, | |
dataType: 'jsonp', | |
crossDomain: true, | |
success:function(data){ | |
// console.log(data); | |
} | |
}) | |
When you go into your filename.php | |
if(issest($_GET['callback'])){ | |
$postname = $_GET['postname']; | |
$postname2 = $_GET['postname2']; | |
// Then do what you want with the information collected. | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment