Hello, me again!
Today I tested my application and it was suddenly broken. I'm not sure if it's somehow a problem on my end, as it was working fine before. (The sandbox still works, however.)
Now, instead of a ShipRush Web application popping up like it should, I get a CORS denial and a "resource cannot be found" in the console. It also refreshes the page for some reason. (I'm currently developing from India, if that's relevant to the CORS denial.)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://my.shiprush.com/ShipButtonPu...adShipmentView. (Reason: CORS request did not succeed).
[Show/hide message details.] ReferenceError: uploadShipmentResponseAsString is not defined[Learn More] webshipping.integration.client.js:123:17
UploadShipmentCompleted
https://my.shiprush.com/static.shipr...ient.js:123:17
error
https://my.shiprush.com/static.shipr...lient.js:83:17
ajax/request.onerror
https://my.shiprush.com/static.shipr...ient.js:282:17
The code is straight from the sandbox:
Today I tested my application and it was suddenly broken. I'm not sure if it's somehow a problem on my end, as it was working fine before. (The sandbox still works, however.)
Now, instead of a ShipRush Web application popping up like it should, I get a CORS denial and a "resource cannot be found" in the console. It also refreshes the page for some reason. (I'm currently developing from India, if that's relevant to the CORS denial.)
Quote:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://my.shiprush.com/ShipButtonPu...adShipmentView. (Reason: CORS request did not succeed).
[Show/hide message details.] ReferenceError: uploadShipmentResponseAsString is not defined[Learn More] webshipping.integration.client.js:123:17
UploadShipmentCompleted
https://my.shiprush.com/static.shipr...ient.js:123:17
error
https://my.shiprush.com/static.shipr...lient.js:83:17
ajax/request.onerror
https://my.shiprush.com/static.shipr...ient.js:282:17
Code:
<!-- External dependencies. Remove these lines if you already use jQuery and JSON.js on your site -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json2/20130526/json2.min.js"></script>
<!-- ShipRush Web Shipping references -->
<link href="https://my.shiprush.com/static.shiprush.com/ship.app/api/webshipping.integration.client.css" rel='stylesheet' type='text/css' />
<script src="https://my.shiprush.com/static.shiprush.com/ship.app/api/webshipping.integration.client.js"></script>
Code:
$("#showIntegratedWebShipping").click(function() {
var shipment = {
ShipTo : {
Name: "John Smith",
Company: "Acme Widgets",
Address1: "5th ave S",
Address2: "#101",
City: "Seattle",
State: "WA",
PostalCode: "98118",
Country: "US",
Phone: "(206)332-2233"
},
CarrierTypeName: "FedEx",
ServiceTypeName: "Ground",
Packages: [{
Weight: "2"
}]
}
shipRushClient.Open(
{
Shipment: shipment,
OnShipmentCompleted: function (data) {
alert(data.Shipment.TrackingNumber);
// Return "true" to close shipping form
return true;
}
});
});