I have created an XML file and can successfully parse the file in jQuery. The XML file consists of pairs of selectors and css/html manipulators.
For example: Here is the console.log.
found session
found child selector
attributes$(".monday td.session.m_2_title")
attributes.css("background-color", "#00ffff");
$(".monday td.session.m_2_title").css("background-color", "#00ffff");
Here is the example code:
$(xml_Data).find("session").each(function() {
console.log("found session");
$(this).children().each(function(){
var tag = this.tagName;
console.log("found child " + this.tagName);
console.log("attributes" + $(this).text());
if (this.tagName == "selector"){
//$(this).next();
console.log("attributes" + $(this).next().text());
console.log($(this).text() + $(this).next().text());
$(this).text() + $(this).next().text();
}
});
});
In a fit of wild optimism I thought this:
$(this).text() + $(this).next().text();
Would cause the script to run the concatenated strings a statement. Obviously this is wrong.
The the question is how do I put the xml data together to create and run the appropriate statement.