XMLファイルを作成し、jQueryでファイルを正常に解析できます。XMLファイルは、セレクターとcss/htmlマニピュレーターのペアで構成されています。
例:これがconsole.logです。
セッションが見つかりました
子セレクターが見つかりました
属性$("。mondaytd.session.m_2_title")
attributes.css( "background-color"、 "#00ffff");
$("。mondaytd.session.m_2_title")。css( "background-color"、 "#00ffff");
サンプルコードは次のとおりです。
$(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();
}
});
});
野蛮な楽観主義の発作で、私はこれを考えました:
$(this).text() + $(this).next().text();
スクリプトが連結された文字列をステートメントで実行するようになります。明らかにこれは間違っています。
問題は、xmlデータを組み合わせて、適切なステートメントを作成して実行するにはどうすればよいかということです。