+ 1

My CDN doesn't seem to work.

I wanted to use paper.js in my code. But it doesn't recognize the "paper" project that makes paper.js work. So I'm guessing that it counts my code's own javascript file first, and then gets the cdn? I couldn't figure out the problem with this one. I'd be glad if someone could help with it? Here's my code: https://code.sololearn.com/W2A5To6K2VM8/?ref=app

5th Mar 2019, 9:00 AM
Dovlet Hallayev
12 Answers
+ 6
Hmm.. if you go onto your web browser, and copy the link for the paper-full.js, will it load on your phone? I’m wondering that maybe it doesn’t load correctly.
5th Mar 2019, 9:10 AM
Rowsej
Rowsej - avatar
6th Mar 2019, 8:37 PM
Rowsej
Rowsej - avatar
+ 4
I would put the paper.install(window) line inside window.onload, so everything is fully loaded when it starts.
5th Mar 2019, 9:03 AM
Rowsej
Rowsej - avatar
+ 4
Hmm... maybe wrap the code in an onload event for the script.
5th Mar 2019, 8:40 PM
Rowsej
Rowsej - avatar
+ 4
Yes, something like that. You could also attach an onerror event if it fails to load.
6th Mar 2019, 8:13 AM
Rowsej
Rowsej - avatar
+ 2
Mende-de şolar ýaly bolýar.Haçanda jquery cdn bilen çagyramda köplenç işlänok. Google cdn we Microsoft cdn şolaň haýsam bolsa biri işleýär beýlekisi işlanök. Eger paper js başga cdn-y bar bolsa barlap gör belki işlär.
5th Mar 2019, 9:30 AM
Maksat Orazsahedow
Maksat Orazsahedow - avatar
+ 2
Howwa kompyuterde meselesiz ishleya yone telde bir problema bar bolaymasa
5th Mar 2019, 9:55 AM
Maksat Orazsahedow
Maksat Orazsahedow - avatar
+ 1
Rowsej It still doesn't recognize it. The thing is, it works on my laptop. But it doesn't in my phone. It actually doesn't matter if it is inside or outside of the window.onload, as long as it's installed before i get to work.
5th Mar 2019, 9:09 AM
Dovlet Hallayev
+ 1
Rowsej it does open the file in web browser.
5th Mar 2019, 9:13 AM
Dovlet Hallayev
+ 1
Maksat Orazsahedow kompyuterde ishlap dur. Bir telefonda bolanok. Yada telefon programmasynyn ishleyshinde bir problema bar bolaymasa. Kompyuterde browserdan giryanda.
5th Mar 2019, 9:42 AM
Dovlet Hallayev
+ 1
Rowsej nice idea actually. So that we know if the script gets loaded or not? So i should probably use console.log("msg")?
6th Mar 2019, 7:20 AM
Dovlet Hallayev
+ 1
Rowsej the strange part is that, when i checked it once more before doing what you told me, it worked.. without any changes
6th Mar 2019, 10:46 AM
Dovlet Hallayev