Skip to content

Instantly share code, notes, and snippets.

@atukilham
Created March 14, 2018 08:36
Show Gist options
  • Select an option

  • Save atukilham/16f37b0b0cafde9ec8985d405153042d to your computer and use it in GitHub Desktop.

Select an option

Save atukilham/16f37b0b0cafde9ec8985d405153042d to your computer and use it in GitHub Desktop.
Sample script for create a trigger to making call from JDFinance System
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<button onclick="dalsMakeCall('xxxxxxxxxx')">CALL</button>
<!-- Change "xxxxxxxxxx" with phone number -->
<script>
function dalsMakeCall(phoneNumber){
let param = { 'uid' : phoneNumber};
let w = 333;
let h = 326;
let left = (screen.width/2)-(w/2);
let top = (screen.height/2)-(h/2);
let urlWindow = ''; //link url will be updated until our server instalation completed.
dalsOpenWindow(urlWindow, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left, "MakeCall", param);
}
function dalsOpenWindow(url, windowoption, name, params){
let form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", url);
form.setAttribute("target", name);
for (let i in params) {
if (params.hasOwnProperty(i)) {
let input = document.createElement('input');
input.type = 'hidden';
input.name = i;
input.value = params[i];
form.appendChild(input);
}
}
document.body.appendChild(form);
window.open("post.htm", name, windowoption);
form.submit();
document.body.removeChild(form);
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment