jQuery

jQueryでxmlを(^ω^)prprする

xml <data> <response_code>200</response_code> <list> <record> <id>1</id> <body_>あああああ</body_> //jQueryでxmlにアクセスする際、既存タグ名と重複は禁忌なので、bodyをbody_にして回避 </record> : : <record> <id>9</id> <body_>いいいいい</body_> </record> </list> </data> js $.ajax ( { type : 'POST', url …

xmlをちょめちょめ

サンプルxml <data> <response_code>200</response_code> <cnt>0</cnt> <onetime_pw>9ByKA1IV61GZx0ootbcJ5ijSrCD1WA095QEjivbRQknSec4BGLLTY56J8eR0iLx5</onetime_pw> </data> JavaScript $(xml).find("response_code").each ( function () { alert( $(this).text() ); } ); $(xml).f…

フォームのテキストやラジオから値を取る

nameから text $("input[name=hoge]:input").val() $("input").filter("[name='hoge[" + y + "]']").val() textarea $("textarea[name=hoge]").val() radio $("input[name=hoge]:checked").val() $("input[name='hoge[" + fuga+ "]']:checked").val() select…

$.ajaxでjsonpの場合は同期設定にできない

http://api.jquery.com/jQuery.ajax/ By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do …