2013-09-29から1日間の記事一覧

window.onload以外でJavascriptを自動実行

こんな感じ <script type="text/javascript"> (function() { alert("ふははははっ、ごほっははっ、ゲホッ"); })() </script>

CSSのCLASSの上書き

通常以下のようにしてclassを指定します。 <style> .red {background-color : red;} .blue {background-color : blue;} </style> ① <div class="red blue"> </div> ② <div class="blue red"> </div> 実はどっちもblueになりますw styleの宣言順に上書きがされるようです。 こちらを参考にしました。http://blog.xole.net/article.php…

wordpressの本番切替時にJSのNotFoundを避ける。

wordpressでhttp://ほげほげ/wordpressとhttp://ほげほげ/を切り替えた際、 JSでエラーが出ないようにする。 var temp_first_url="http://"+location.host+"/"; if(location.href.indexOf("wordpress")) temp_first_url+="wordpress/"; あとはいつもの image…