1 2 3 4 5 6 | #import sys #路徑為安裝時的預設路徑,版號可能不同 #sys.path.append('C:\tcc_gnuplot_lite\data\SciTE\Lib') import calendar #month(年, 月, 寬度, 高度) print (calendar.month( 2011 , 12 , 6 , 2 )) |
說明:
直接執行於Python interpreter。
使用python內建library迅速寫出月曆。
大於取代為『>』小於取代為『<』
Tab字元取代為『 』
換行字元取代為『 』
雙引號取代為『\"』
&取代為『&』 | ||
高亮程式:『<pre class="brush:js;first-line:1;highlight:[0];">』+字串+『</pre>』 (含HTML架構『html-script:true;』) | ||
多行複製:『<textarea style="width:100%;overflow:visible" onclick="select()" rows="">』+字串+『</textarea>』 | ||
彈出框架:『<a href="javascript:;" onclick="window.open('"』+網址+『"', 'images', 'catalogmode, scrollbars, width=, height=')">Open</a>』 | ||
不作改變 | ||
1 2 3 4 5 6 | #import sys #路徑為安裝時的預設路徑,版號可能不同 #sys.path.append('C:\tcc_gnuplot_lite\data\SciTE\Lib') import calendar #month(年, 月, 寬度, 高度) print (calendar.month( 2011 , 12 , 6 , 2 )) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > <html xmlns= "http://www.w3.org/1999/xhtml" lang= "zh-TW" xml:lang= "zh-TW" > <head> <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" /> <title>Jsonp dynamic</title> <script type= "text/javascript" > function codeboxy(json) { document.getElementById( "youtubeTitle" ).innerHTML = json.entry.title.$t; } function getYoutubeTitle() { var removeScript = document.getElementById( 'jsonScript' ); if (removeScript) removeScript.parentNode.removeChild(removeScript); var yid = document.getElementById( 'yid' ).value; var script = document.createElement( 'script' ); script.type = 'text/javascript' ; script.id = 'jsonScript' ; script.src = "http://gdata.youtube.com/feeds/api/videos/" + yid + "?alt=json-in-script&callback=codeboxy" ; document.getElementsByTagName( 'head' )[0].appendChild(script); } </script> </head> <body> <input type= "text" id= "yid" value= "Sr3hyvjNp94" /> <input type= "button" onClick= "getYoutubeTitle()" value= "Get" /> <div id= "youtubeTitle" ></div> </body> </html> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> < html xmlns = "http://www.w3.org/1999/xhtml" lang = "zh-TW" xml:lang = "zh-TW" > < head > < meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" /> < title >Hello JavaScript</ title > < style > a:hover { background: yellow; } </ style > < script type = "text/javascript" > function hello() { document.getElementById("codeboxy").innerHTML += "Hello JavaScript< br />"; } </ script > </ head > < body > < a href = "javascript:hello();" >Click me</ a > < div id = "codeboxy" ></ div > </ body > </ html > |
1 2 3 | <script type= "text/javascript" > alert( "Hello JavaScript" ); //彈出訊息框 </script> |
1 2 3 4 | <?php echo "Hello PHP" ; //印出Hello PHP文字 phpinfo(); //顯示伺服器資訊 ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <script type= "text/javascript" > function getIframe(name) { var ifr; if (document.all) ifr = document.frames[name].document; //IE else ifr = document.getElementById(name).contentDocument; //FF return ifr; } function test() { alert(getIframe( "childiframe" ).getElementById( "codeboxy" ).innerHTML); } </script> <iframe id= "childiframe" name= "childiframe" src= "child.html" ></iframe><br /> <a href= "javascript:test();" >Click me</a> |
1 | < div id = "codeboxy" >Hello Codeboxy</ div > |