I currently have the following set up for my jQuery request, which is meant to find an element on the page with the id "myid" and apply new CSS rules to it. These rules are not known beforehand, and so I first read a file and store the results in a string array, with the even indexes being the rules and the odd indexes being the values. However, jQuery refuses to let this work. I've trawled over the documentation to no avail, and all I get is that apparently words[0] is of type string[], not string (which shouldn't be the case).
Can I get some advice on this? Here is an example of what I mean:
var words = ["color", "blue", "font-size", "100"]; // these have been parsed from a file and formatted
$("#myid").css({words[0] : words [1], words[2], words[3]}); // This won't apply