Redirect Widget
Widget for a given product with a given amount. Redirect to platform either directly or by clicking on a targeted DOM element.
Required parameters
- Branch id
- Widget id
- Loan purpose (be sure to select the right loan purpose)
- Order description
- Order reference
- Amount
Other parameters
When the widget script is added to your page, the redirection will take place automatically. If you add a 'trigger' parameter with a CSS selector as value, the redirection will take place when the target element is clicked.
You can choose whether the redirection takes place in the same window or in a new window by using the 'target' parameter.
In addition, you can pass a specific duration.
By default, the widget's language is Dutch, unless the user's browser is in French. If required, a 'language' parameter can be added, with a value of either 'fr' or 'nl'.
Personalize your own widget
2. Copy the following code and paste it in your website
<script>
var params = {
'test' : ,
'branchId' : '',
'widgetId' : '',
'widgetMode' :
'trigger' : '',
'purposeId' : '',
'duration' : ,
'language' : '',
'orderDescription' : '',
'orderReference' : '',
'amount' : ,
'firstName' : '',
'lastName' : '',
'email' : '',
}
var fjs=document.currentScript;
if(document.querySelector(params.trigger)){
document.querySelector(params.trigger).onclick=e=>{
e.preventDefault();
appendJs(document,'script',params);
}
}else{
appendJs(document,'script',params);
}
function appendJs(d,s,p){
var n=Math.floor(Math.random() * 1001);
var id='lw-js-redirect-'+n;
var js;
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id
js.src= `https://assets.mozzeno.com/widgets/loanwidget/assets/app/script-redirect.js?timestamp=${n}`;
js.type='module';
js.dataset.params=JSON.stringify(p);
fjs.parentNode.insertBefore(js,fjs);
setTimeout(() => {
document.querySelector('[id*="lw-js-redirect-"]').remove();
}, 3000)
}
}
</script>