Untitled Document
Results 1 to 3 of 3

Thread: Javascript SDK OnClose event

  1. #1
    I'm unable to get the OnClose event to work. When clicking the X to close the shipment window, I want to do some actions. I tested the example below in your Javascript playroom and the console.log line does not get printed.

    Code:
    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"
        }
    }
    
    shipRushClient.Open(
    {
        Shipment: shipment,
        OnShipmentCompleted: function (data) {
            alert(data.Shipment.TrackingNumber);
            // Return "true" to close shipping form
            return true;
        },
       OnClose: function(){
          console.log('closed window');
       }
    });

    If I do the OnAction callback, it does work (see below).

    Code:
    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"
        }
    }
    
    shipRushClient.Open(
    {
        Shipment: shipment,
        OnShipmentCompleted: function (data) {
            alert(data.Shipment.TrackingNumber);
            // Return "true" to close shipping form
            return true;
        },
       OnAction: function(event, data){
          console.log('closed window');
       }
    });

  2. #2

    Join Date
    Apr 2004
    Posts
    16,807
    SYSOPS is offline
    This is under investigation. Case 75202. We will update here when more information is available.

    Thank you,
    SYSOPS
    Have Questions? Ask the ShipRush Knowledge Base: https://shiprush.com/kbase
    Reply With Quote

  3. #3

    Join Date
    Apr 2004
    Posts
    16,807
    SYSOPS is offline
    More information from a prior internal case on this issue. (Case 68071)

    Looks like chrome changed browser security and not allowing us to send onClosed message if protocol (http or https) are not matching.
    It is working only with https protocol.

    Firefox working either way.

    I would recommend customer to use FF for development or use https protocol with our sbox and prod

    HTH,
    SYSOPS
    Have Questions? Ask the ShipRush Knowledge Base: https://shiprush.com/kbase
    Reply With Quote

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •