我正在Laravel 4中使用omnipay實現Paypal Express。 狀態碼:302當我的網站嘗試重定向到PayPal時發現。不能重定向到PayPal使用omnipay與標題中的JQuery
錯誤:
XMLHttpRequest cannot load https://www.sandbox.paypal.com/xxxxxxxx . No 'Access-Control-Allow-> Origin' header is present on the requested resource. Origin ' http://www.example.com ' is ??> therefore not allowed access.
其實我發現,如果我刪除以下Jquery的頭在我purchase.blade.php它會正常工作。我正在使用Controller將調用提交給paypal(不是ajax調用)。
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
不過,我需要Jquery。 任何想法或解決方法?
謝謝
這可能是一個類似的問題在這裏描述和很好的回答:http://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource –
你可以發佈你正在執行的代碼嗎?你有沒有嘗試將你的jQuery腳本設置爲https?您自己的服務器是否以HTTPS或HTTP運行? – danielwinter