+ 1
How to import Js libraries into SL playground?
Hello guys, Iâm currently working with Js and Iâd like to import a library into SL playground. How can I do it?
18 Respostas
+ 6
I don't know what libraries you have in mind, but maybe you can use CDN and link them in your project.
https://cdnjs.com/
+ 6
Of course, like any other script link. âī¸
+ 5
Great, it's looking amazing.
Window.onload is not written correctly.
Put this instead of the first line:
window.onload= function() {
When I uncomment the seventh line it works fine for me.
đđ
+ 4
You obviously have one extra closing braces in line 10, read the error report.
However, it seems that won't solve the issue. One more file is missing, you'll need to read the official documents and also this thread on github :
https://github.com/dwa012/html5-qrcode/issues/36
https://code.sololearn.com/WZbCZ756EC7Z/?ref=app
+ 3
Alright. I don't know what else to tell, except to try their official example maybe that will work for you :
https://davidshimjs.github.io/qrcodejs/
+ 2
Yes, that should be added too to your project. That's why you see that error.
I see a qr code ? It shows every time.
Maybe you should try this code outside sololearn.
+ 2
dĪlĪ
ŅĪlĪ
Ņ are you able to see different profiles by changing the âprofile numberâ input?
For example: your profile number is 2251477. Thus, once you put it into the first input the qrcode should lead to your profile page because itâs sololearn.com/profile/2251477
EDIT: iâve added .toString() method in the 7th line so that the number typed in the input turns into a string. But still doesnât work out properly. There must be an error in the 78th line
EDIT2: solved!
+ 1
hi dĪlĪ
ŅĪlĪ
Ņ , thanks for answering. I need to use the qrcode.js library and implement it into the HTML code
+ 1
So i just need to type in the HTML
<script type=âtext/javascriptâ src=âhttps://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.jsâ></script>
Right?
+ 1
thank you dĪlĪ
ŅĪlĪ
Ņ !
+ 1
https://code.sololearn.com/WO8yZOtCk7Lr/?ref=app
Canât find out why it says âSyntax Errorâ
đ¤
+ 1
Thanks for your patience, i know itâs annoying...
Almost finished my code, just miss the qrcode script implementation
https://code.sololearn.com/Wpw8c3rVXKa9/?ref=app
+ 1
Ok dĪlĪ
ŅĪlĪ
Ņ good news, found a way to display the qrcode through JQuery!!đ Now just have to solve the problem at line 64 of the Js file. That inp1 var is not recognised
0
The error is: ReferenceError: Can't find variable: QRCode at Line: 1
Got few questions. That one in the Js section is a library?
Run your code but it shows nothing, just a white background
0
Ok found that it doesnât work on ios devices.
Then i pasted the code on Codepen (pc) to see if it works and it doesnât. You can check it here â>
https://codepen.io/Gintonicc/pen/EBEWev
0
The problem is that the qrcode shows just the link https/sololearn.com/profile while it should display the https:/sololearn.com/profile/ + number of the profile (which you put in the first input). Thatâs like the inp1 var doesnât work