Hallo.
Wie kann man einen sequentieller Container, einer Variablen Function mitgeben?
Hier soll "dict" mit.
test(dict,"argument1","argument2",......)
JS Bin - Collaborative JavaScript Debugging
Wie kann man einen sequentieller Container, einer Variablen Function mitgeben?
Hier soll "dict" mit.
test(dict,"argument1","argument2",......)
JS Bin - Collaborative JavaScript Debugging
Code:
var filterkeys = [];
var wraptotr = [];
var wraptotd = [];
var wraptoth = [];
var dict = [{
Name: "Horst",
Alter: "22"
}, {
Name: "Paul",
Alter: "40"
}];
function c(a) {
console.log(a);
}
// dict muß mit!!!!
function test() {
var varops = [];
for (var i = 0; i < arguments.length; i++) {
varops.push(arguments[i]);
}
for (var e = 0; e < varops.length; e++) {
varops[e].substring(0, 5) === "fkey_" ?
filterkeys.push(varops[e].slice(5).split(",")) : "";
varops[e].substring(0, 5) === "wttr_" ?
wraptotr.push(varops[e].slice(5)) : "";
varops[e].substring(0, 5) === "wttd_" ?
wraptotd.push(varops[e].slice(5)) : "";
varops[e].substring(0, 5) === "wtth_" ?
wraptoth.push(varops[e].slice(5)) : "";
}
c(wraptotr);
c(filterkeys);
c(wraptoth);
c(wraptotd);
}
test("wttr_class='zeilen color300'", "fkey_Name,Ort,Alter", "wttd_style='background-color:lightgrey;color:blue;'", "wtth_class='round blue'");