I get this error when I load this page :
No 'Access-Control-Allow-Origin' header is present on the requested resource.
and complete error is this :
XMLHttpRequest cannot load https://app.getresponse.com/add_contact_webform.html?u=WOoS. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://vieillemethodecorpsneuf.com' is therefore not allowed access.
How can we solve this? Can I put something in the .htaccess file to resolve it?
Please be aware that this page is build under the Wordpress OptimizePress plugin and even if there's a module that can help me to put code in the HEAD section, OP do not allow me to render PHP code with this module. So it is hard to put this code in header:
<?php
header("Access-Control-Allow-Origin: *");
By the way, the complete code that is refering to is :
<?php
$clickbank_name = (isset($_GET['cname'])) ? $_GET['cname'] : '';
$clickbank_email = (isset($_GET['cemail'])) ? $_GET['cemail'] : '';
$clickbank_country = (isset($_GET['ccountry'])) ? $_GET['ccountry'] : '';
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var cname = '<?php echo $clickbank_name; ?>';
var cemail = '<?php echo $clickbank_email; ?>';
var ccountry = '<?php echo $clickbank_country; ?>';
var webform_id = '5068102'; //here your webform id
var dataString = ‘name='+cname+'&email='+cemail+'&custom_country='+ccountry+'&webform_id='+webform_id;
$.ajax({
type: "POST",
url: "https://app.getresponse.com/add_contact_webform.html?u=WOoS",
data: dataString
});
});
</script>