2009-11-01から1ヶ月間の記事一覧
JSON文字列中に"\n"があると、prototype.jsのevalJSON()が通らない。 json.replace(/\n\r|\r\n|\n|\r/, "<br />"); とでもする。 htmlソース中にJSONを出力する場合 GIRAFFE::Json::array_escape()を噛ます。
var select = document.createElement("select"); var option_google = document.createElement("option"); var option_yahoo = document.createElement("option"); var option_baidu = document.createElement("option"); option_google.setAttribute("valu…
idやname等は設定できるがイベントハンドラは無理みたい。 解決方法 if(IE系なら) { hogeElement.setAttribute("onclick", new Function( "o_hoge.hoge()" ) ); } else { hogeElement.setAttribute("onclick", "o_hoge.hoge()" ); } setAttributeの第二引数…