Comments (9)
I think you're right, the splice call is needlessly verbose as written. it should just be script_list.splice(splice_args)
.
I'm not sure I understand your second question. $LAB.script("test1.php", ["test2.php", "test3.php"])
should in fact load all 3 scripts. Are you seeing it not do so?
from labjs.
$LAB.script(['test1.php',['test2.php','test3.php']]);
it just has one parameter ['test1.php',['test2.php','test3.php']] ,not two parameters "test1.php" and ["test2.php", "test3.php"]
from labjs.
I'm sorry, I still don't understand your question. In your example, is it loading all 3 scripts or not?
from labjs.
... I try it again , that may be my mistake
from labjs.
I push the example to internet .http://dexbol.sinaapp.com/labjs/
from labjs.
OK, I see and can reproduce the problem... very strange. But thank you for the bug report. I'll get on fixing it.
from labjs.
OK, I figured out what the bug was, and have fixed it (will come out in 2.0.2 when I get that release out, asap). Those few lines now read (including comments to explain what the heck I was doing!):
if (is_array(script_obj)) {
// set up an array of arguments to pass to splice()
splice_args = [].slice.call(script_obj); // first include the actual array elements we want to splice in
splice_args.unshift(j,1); // next, put the `index` and `howMany` parameters onto the beginning of the splice-arguments array
script_list.splice.apply(script_list,splice_args); // use the splice-arguments array as arguments for splice()
j--; // adjust `j` to account for the loop's subsequent `j++`, so that the next loop iteration uses the same `j` index value
continue;
}
Thanks again for helping find this bug!
from labjs.
OK,thanks for your code and explain too.
from labjs.
fixed in v2.0.2
from labjs.
Related Issues (20)
- BOM issues HOT 4
- HTTP2 or SPDY and LABjs HOT 2
- swallowing errors doesn't seem right HOT 1
- It's nearing time for 3.0 HOT 31
- LAB inserts scripts at the beginning of the <head> HOT 7
- how to use LAB when Chrome blocks inline scripts ? HOT 2
- LABjs regular expression breaks for Windows apps
- Why not add localStorage to cache the scripts? HOT 6
- What is the role of first line?
- labjs.com is down HOT 1
- Recovering from 404 HOT 1
- Refactor out arguments.callee HOT 1
- huge longshot, but... might be a bug with LAB.js here. HOT 8
- www.labjs.com is not working
- LABjs blocking the executation of jquery each()
- setAttribute("as", "script") in chrome 51.0.2704.84 window7 messy code
- Seeking for a stable v3.0 package
- Current project status HOT 2
- [Question] Does LABjs scrub out the debugger keyword? HOT 2
- JsDelivr - I can't see '.js' files HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labjs.