0
Please don’t show me the documentation link http://labjs.com/documentation.php or examples taken from there because this I have read, and honestly did not understand why my error code "from time to time" that is, the page loads about three times and then one of the error.
So I’m believing that the problem is the asymchronism, I’ve already moved a lot in the order of scripts, putting . Wait in everything, only in a few and finally came to nothing follows the last test:
$LAB
.script('../js/date.js') // NAO TEM DEPENDENCIA
.script('../js/plugin/jquery.insc.estadual.js') // NAO TEM DEPENDENCIA
.script('../js/node/socket.io.js').wait() // NAO TEM DEPENDENCIA
.script('../js/js_1.9/jquery-1.8.2.js').wait() // NAO TEM DEPENDENCIA
.script('../js/jquery.shortcuts.min.js') // DEPENDE DE JQUERY
.script('../js/jquery.meiomask.js') // DEPENDE DE JQUERY
.script('../lib/jquery.validate.js') // DEPENDE DE JQUERY
.script('../js/js_1.9/jquery-ui-1.9.1.custom.min.js').wait() // DEPENDE DE JQUERY
.script('../js/dataBr.js') // DEPENDE DE JQUERY E JQUERY-UI
.script('../js/plugin/jquery.zoomooz.js') // DEPENDE DE JQUERY E JQUERY-UI
.script('../js/custom_jquery.js?nocache='+Math.random()) // DEPENDE DE JQUERY E JQUERY-UI
.script('../js/principal.js?nocache='+Math.random()); // DEPENDE DE JQUERY , JQUERY-UI E SOCKET.IO
Errors that appear sporadically are:
I’m more lost than early in shooting, someone can give me help ?
I’m not an expert in
php
and much less inlabjs
, but from what I understand of his workings, you don’t need await()
to thesocket.io
and thejquery.insc.estadual
depends on jquery, so it should come after it, finally I believe it is necessary await()
before theprincipal.js
, as in this codebin– Tobias Mesquita
@Tobymosque thought that jquery.insc.estadual has dependency because of the file name, but I’ve opened the file and it’s pure javascript, I put the name in it wrong, the socket.io I put it in the
wait
because the main.js depends on it– SneepS NinjA
from what I understand from
labjs
, it will asynchronously download the files, thewait()
will cause it to wait for all scripts to download and run before continuing, then putting thewait()
after thejquery.js
, will make him wait for the completion ofdate.js
,insc.estadual.js
,socket.io.js
and thejquery.js
, then there is no need for await()
to thesocket.io
. really the name ofinsc.estadual.js
made me think he depended onjquery.js
.– Tobias Mesquita
But I still believe
principal.js
make some use ofdataBr.js
,zoomooz.js
orcustom_jquery.js
, so I asked to put await()
after thecustom_jquery.js
– Tobias Mesquita
tried but did not resolve
– SneepS NinjA
the problem must be script conflict, some script is conflicting with others, and when it loads faster than the other, it gives this error. Try to change their order and run tests. I believe jquery should always stay at the top. I wouldn’t trust this one
.wait()
– Ivan Ferrer
@Ivanferrer the whole idea is based on the confidence of this . Wait() rsrsrsrsr, the jquery on top as first was my first attempt, I ended up putting others on top of it to separate what has no dependency, but thank you anyway
– SneepS NinjA