|
|
|
@ -13,13 +13,7 @@ function callback(response) {
|
|
|
|
|
return_first = response; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getSCurveData(){ |
|
|
|
|
|
|
|
|
|
// Send a message to the parent window requesting the URL
|
|
|
|
|
window.parent.postMessage({ action: 'getUrl' }, '*'); |
|
|
|
|
|
|
|
|
|
// Listen for messages from the parent window
|
|
|
|
|
window.addEventListener('message', function(event) { |
|
|
|
|
function messageListener(event) { |
|
|
|
|
if (event.data && event.data.action === 'sendUrl') { |
|
|
|
|
const parentUrl = event.data.url; |
|
|
|
|
|
|
|
|
@ -39,6 +33,7 @@ function getSCurveData(){
|
|
|
|
|
data: JSON.stringify(sCurvePayload), |
|
|
|
|
success: function (data) { |
|
|
|
|
callback(data) |
|
|
|
|
window.removeEventListener('message', messageListener); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$.ajax({ |
|
|
|
@ -61,11 +56,16 @@ function getSCurveData(){
|
|
|
|
|
data: JSON.stringify(sCurvePayload), |
|
|
|
|
success: function (data) { |
|
|
|
|
callback(data) |
|
|
|
|
window.removeEventListener('message', messageListener); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getSCurveData() { |
|
|
|
|
window.parent.postMessage({ action: 'getUrl' }, '*'); |
|
|
|
|
window.addEventListener('message', messageListener); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function toggleOverlay() { |
|
|
|
|