-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
39 lines (31 loc) · 1.15 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function genQR()
{
let gapi="https://api.qrserver.com/v1/create-qr-code/?data=";
let myimg=document.getElementById("img");
let mytext=document.getElementById("qrtext").value;
let mysize=document.getElementById("size").value;
if (mytext!=="" && mysize=="100")
{
myimg.src=gapi+mytext+"!"+";"+"&size=100x100";
//http://api.qrserver.com/v1/create-qr-code/?data=HelloWorld!&size=100x100
} else if(mytext!=="" && mysize=="150")
{
myimg.src=gapi+mytext+"!"+";"+"&size=150x150";
}
else if(mytext!=="" && mysize=="200")
{
myimg.src=gapi+mytext+"!"+";"+"&size=200x200";
}
else if (mytext!=="" && mysize=="250")
{
myimg.src=gapi+mytext+"!"+";"+"&size=250x250";
}
else if (mytext!=="" && mysize=="300")
{
myimg.src=gapi+mytext+"!"+";"+"&size=300x300";
}
else
{
alert("Please Enter Text");
}
}