Merge pull request #26549 from woocommerce/fix/26493-error-handling
Call callback on tracking script load error
This commit is contained in:
commit
12ff70fb14
|
@ -115,7 +115,14 @@ class WC_Site_Tracking {
|
|||
// Callback after scripts have loaded.
|
||||
script.onload = function() {
|
||||
if ( 'function' === typeof callback ) {
|
||||
callback();
|
||||
callback( true );
|
||||
}
|
||||
}
|
||||
|
||||
// Callback triggered if the script fails to load.
|
||||
script.onerror = function() {
|
||||
if ( 'function' === typeof callback ) {
|
||||
callback( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue