Открывать всплывающее окно при сканировании штрих-кода

Я пытаюсь вызвать функцию js, которая откроет маленькую страницу при сканировании штрих-кода. Это может быть достигнуто?

Это мой код:

<script>
function PopupCenter(url, title, w, h) {

var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft  :screen.left;
var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;

width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;

var left = ((width / 2) - (w / 2)) + dualScreenLeft;
var top = ((height / 2) - (h / 2)) + dualScreenTop;
var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);

//  Puts focus on the newWindow
if (window.focus) {
newWindow.focus();
newWindow.document.bgColor="grey";
//window.opener.document.body.style.backgroundColor = "grey";
}
}
</script>

<form method="post" action="action.php">
<input type="button" class="searchbutton" value="" onclick="PopupCenter('barcode.php','BARCODE',1000,500)"/>
</form>

заранее спасибо

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector