いつまで続くか分かりませんが、 情報発信を開始しました。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="ja"><head><title> .:: Sample Play Keepaway ::. Ajax-02</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="cache-control" content="no-cache"><meta name="Author" content="Sample"><meta http-equiv="Content-Script-Type" content="text/javascript"><link rel="stylesheet" href="css/blue/style.css" type="text/css" media="print, projection, screen" /><link rel="stylesheet" href="css/default.css" type="text/css" /><script language="Javascript" type="text/javascript" charset="UTF-8" src="js/lib/jquery-1.3.2.min.js"></script><script type="text/javascript">$(function(){ $('#convertButton').click(function(){ var d = $('#date_text').val(); $('#result').html(d.getSeireki()); });});String.prototype.getSeireki = function() { var ret = this.match(/[0-9]+/g); var wareki = this.substring(0,this.indexOf(ret[0])); var n = ret[0]; var result = ''; if ("昭和" == wareki || "S" == wareki) { result = parseInt(n) + 1925; } else if ("平成" == wareki || "H" == wareki) { result = parseInt(n) + 1988; } else if ("大正" == wareki || "T" == wareki) { result = parseInt(n) + 1911; } else if ("明治" == wareki || "M" == wareki) { result = parseInt(n) + 1867; } return result + '年';}</script></head><body><div class="preview"><input type="text" style="width: 20em;" name="date" value="昭和56" id="date_text"><input type="button" value="西暦変換" style="width: 180px; height: 30px;" id="convertButton"><div id="result"></div></div></body></html>
0 件のコメント:
コメントを投稿