<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic &amp;quot;Loading...&amp;quot; message using AcceptUI.js on slow network in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Loading-quot-message-using-AcceptUI-js-on-slow-network/m-p/67647#M41015</link>
    <description>&lt;P&gt;I've seen &lt;A href="https://community.developer.authorize.net/t5/forums/searchpage/tab/message?filter=location&amp;amp;q=acceptui.js+loading&amp;amp;location=forum-board%3AIntegration01" target="_blank" rel="noopener"&gt;many similar posts on the &lt;/A&gt;forurm regarding just seeing the never-ending "Loading..." message (originating from &lt;A href="https://js.authorize.net/v3/acceptMain/acceptMain.html" target="_blank" rel="noopener"&gt;https://js.authorize.net/v3/acceptMain/acceptMain.html&lt;/A&gt;) on slow network connections. My client experiences this often but I'm only able to recreate it when 1) I throttle the network down to 3G speeds and 2) disable browser caching. I do not see any script errors in the console and all network traffic has completed before I click the payment button. The SCRIPT tag to load AcceptUI.hs appears on the page directly after the "button".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone found a solution for this problem?&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2019 13:10:47 GMT</pubDate>
    <dc:creator>JonnyRoller</dc:creator>
    <dc:date>2019-05-08T13:10:47Z</dc:date>
    <item>
      <title>"Loading..." message using AcceptUI.js on slow network</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Loading-quot-message-using-AcceptUI-js-on-slow-network/m-p/67647#M41015</link>
      <description>&lt;P&gt;I've seen &lt;A href="https://community.developer.authorize.net/t5/forums/searchpage/tab/message?filter=location&amp;amp;q=acceptui.js+loading&amp;amp;location=forum-board%3AIntegration01" target="_blank" rel="noopener"&gt;many similar posts on the &lt;/A&gt;forurm regarding just seeing the never-ending "Loading..." message (originating from &lt;A href="https://js.authorize.net/v3/acceptMain/acceptMain.html" target="_blank" rel="noopener"&gt;https://js.authorize.net/v3/acceptMain/acceptMain.html&lt;/A&gt;) on slow network connections. My client experiences this often but I'm only able to recreate it when 1) I throttle the network down to 3G speeds and 2) disable browser caching. I do not see any script errors in the console and all network traffic has completed before I click the payment button. The SCRIPT tag to load AcceptUI.hs appears on the page directly after the "button".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone found a solution for this problem?&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 13:10:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Loading-quot-message-using-AcceptUI-js-on-slow-network/m-p/67647#M41015</guid>
      <dc:creator>JonnyRoller</dc:creator>
      <dc:date>2019-05-08T13:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: "Loading..." message using AcceptUI.js on slow network</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Loading-quot-message-using-AcceptUI-js-on-slow-network/m-p/67887#M41192</link>
      <description>&lt;P&gt;I found a “band-aid”:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Authorize.net's modal fails to load on slow networks for the first time.&lt;BR /&gt;But it loads fine on the second page load...&lt;BR /&gt;&lt;BR /&gt;Preload the modal, then remove it along with the script, then load the script again, which in turn will load the modal again:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let script;
let iframe;
const PROVIDER_FILES_TO_LOAD = 2;
let providerFilesLoaded = 0;

// Should be disabled by default
const button = document.querySelectorAll( BUTTON_SELECTOR );

init();

function init() {
    preloadModal();
    createScript();
}

function preloadModal() {
    iframe = document.createElement( 'iframe' );
    iframe.src='https://js.authorize.net/v3/acceptMain/acceptMain.html';
    iframe.classList.add( 'visuallyHidden' ); // Make it 1x1 or something like that, so user doesn't see it
    iframe.addEventListener( 'load', enableButton );

    document.body.append( iframe );
}

function createScript() {
    script = document.createElement( 'script' );
    script.src='https://js.authorize.net/v3/AcceptUI.js';
    script.addEventListener( 'load', enableButton );

    document.body.append( script );
}

function enableButton() {
    providerFilesLoaded += 1;

    // Wait for all provider files to load, then remove them, and load again
    if ( providerFilesLoaded === PROVIDER_FILES_TO_LOAD ) {
        iframe.remove();
        script.remove();

        createScript();
    }
    else if ( providerFilesLoaded === PROVIDER_FILES_TO_LOAD + 1 ) {
        button.disabled = false;
    }
}

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 16:53:14 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/quot-Loading-quot-message-using-AcceptUI-js-on-slow-network/m-p/67887#M41192</guid>
      <dc:creator>authorizeme</dc:creator>
      <dc:date>2019-05-31T16:53:14Z</dc:date>
    </item>
  </channel>
</rss>

