最新回應

Loading...

2014年3月17日 星期一

lab 10 Regular expression I

<html>
    <head>
    </head>
 <body id="body">
      <form action="javascript:void(0);" id="exampleForm1">
      <input  id="examplePass" />
   <input type="submit" />
      </form>
 </body>
 <script>

 document.getElementById("exampleForm1").onsubmit = function() {
   var passwordRegex = /-?\d+(\.\d+)?$/;   //此行判斷是否正確



   if(!passwordRegex.test(document.getElementById("examplePass").value)){
        console.log("Regex didn't match");
     var notify = document.getElementById("notify");
     if(notify === null) {
        notify = document.createElement("p");
     notify.textContent = "此數非整數或小數,為錯誤輸入"
     notify.id = "notify";

     var body = document.getElementById("body");
     body.appendChild(notify);
   }
  }

 };
      </script>
 </html>



判斷輸入是否為整數或小數



Lab 8 Using browsers for programming II

要求:撰寫一個網頁能夠自動檢查輸入的密碼,長度必須至少六個字元,且必須至少包含一個數字以及一個非英文字母的字元。


<html>
    <head>
    </head>
 <body id="body">
      <form action="javascript:void(0);" id="exampleForm">
      <input type="password" id="examplePass" />
   <input type="submit" />
      </form>
 </body>
 <script>

 document.getElementById("exampleForm").onsubmit = function() {
      //R
  
  
   var passwordRegex = /^(?=.*\d)(?=.*[\W_]).{6,}$/;
  
  
  
   if(!passwordRegex.test(document.getElementById("examplePass").value)){
        console.log("Regex didn't match");
     var notify = document.getElementById("notify");
     if(notify === null) {
        notify = document.createElement("p");
     notify.textContent = "密碼必須>=6 ,其中第一個字必須是數字,內部至少必須要有一個非英文的符號"
     notify.id = "notify";
    
     var body = document.getElementById("body");
     body.appendChild(notify);
   }
  }
 };
      </script>

 </html>










Lab 7 Using browsers for programming










<html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleform">
<input type="password" id="examplePass" />
<input type="submit" />
</form>
</body>
<script>

document.getElementById("exampleform").onsubmit=function() {
var passwordregex = /^[A-Za-z\d]{6,}$/;

if(!passwordregex.test(document.getElementById("examplePass").value)){
console.log("regex didn't match");
var notify = document.getElementById("notify");
if(notify === null){
notify = document.createElement("p");
notify.textContent="Passwords need to be between 6 and 8 characters long and consist of uppercase characters, lowercase caracters, and digits only."
notify.id = "notify";
var body = document.getElementById("exampleform");
body.appendChild(notify);
}
}
};
</script>
</html>

Lab 6:Using Chrome

http://www.cycu.edu.tw/

最耗時的三個元件:

1.paper_photo2small.jsp?sn=20493 

2.  btn4_1.gif

3.btn10_1.gif


http://www.youtube.com/

最耗時的三個元件:

1.html5player-ima-zh_TW-vflbIC5qP.js

2.www-player-2x-webp-vflwPFWm_.css

3.www-player-2x-webp-vflwPFWm_.css


https://www.udacity.com/

最耗時的三個元件:

1.pxj?bidder=172&seg=802787&action=setuid(%27YzQ1Nzc5MjAxNGNlYzk0MTUzM2ZiMGIyNmY5YzY2NmE%27)

2.adsct?p_user_id=YzQ1Nzc5MjAxNGNlYzk0MTUzM2ZiMGIyNmY5YzY2NmE&p_id=823423

3.?label=g1sKCPi-ywYQgL6YvQM&script=0&ct_cookie_present=false&random=3309788199



2014年3月10日 星期一

notepad++ code (lab7)

<html>
<head>
</head>
<body id="body">
<from action="javascript:void(0);" id="exampleform">
<input type="password"  id="examplepassword" />
<input type="submit" />
</form>
</body>
<script>
document.getElementById("exampleForm").onsubmit = function(){
var passwordregex = /^[A-Za-z\d]{6,}$/;

if(!passwordregex.test(document.getElementById("examplepass").value))
{
var notify = document.getElementById("notify");
if (notify==null){
notify = document.createElement("p");
notify.textcontent = "passwords,need to be least 6 characters long
 and consist of uppercase characters , lowercase
 characters , and digits only."
notify.id = "notify";
var body = document.getElementById("body");
body.appendChild(notify);
}
}
};

</script>

</html>

test 2 :

<html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
<input type="password" id="examplePass" />
<input type="submit" />
</form>
</body>
<script>


document.getElementById("exampleForm").onsubmit = function(){
var passwordregex = /^[A-Za-z\d]{6,}$/;

if(!passwordregex.test(document.getElementById("examplepass").value))
{

console.log("regex didn't match");
var notify = document.getElementById("notify");
if (notify === null){
 notify = document.createElement("p");
notify.textContent="passwords,need to be least 6 characters long and consist of uppercase characters , lowercase  characters , and digits only."

 notify.id = "notify";
 var body = document.getElementById("exampleform");
 body.appendChild(notify);
}
}
};

</script>


correct :
<html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleform">
<input type="password" id="examplePass" />
<input type="submit" />
</form>
</body>
<script>

document.getElementById("exampleform").onsubmit=function() {
var passwordregex = /^[A-Za-z\d]{6,}$/;

if(!passwordregex.test(document.getElementById("examplePass").value)){
console.log("regex didn't match");
var notify = document.getElementById("notify");
if(notify === null){
notify = document.createElement("p");
notify.textContent="Passwords need to be between 6 and 8 characters long and consist of uppercase characters, lowercase caracters, and digits only."
notify.id = "notify";
var body = document.getElementById("exampleform");
body.appendChild(notify);
}
}
};
</script>
</html>


Lab 5:Using Labels

如右上
標籤

標籤名為Lab

Lab 9 使用Google Docs 下OX 棋


Lab 4:破解網路大學排名DIY

1.網頁數(Size) 
中原 : Google約有 
1,230,000 項結果 (cycu)
 台大 : Google約有 
903,000 項結果 (ntu)
 中正 : Google約有 
 1,440,000 項結果(ccu)
 元智 : Google約有 
269,000 項結果 (yzu)



2.連結度(能見度 Visibility) 
中原 : Google約有 
2513 項結果
 台大 : Google約有 
19539 項結果
中正 : Google約有 
2562 項結果
元智 : Google約有 5363 項結果



3.檔案數(Rich files) 
中原 : Google約有 16,300項結果
 台大 : Google約有 
433,000 項結果
 中正 : Google約有 
23,900 項結果
 元智 : Google約有 
14,200 項結果



4.Google Scholar 論文索引
中原 : Google約有 
11,400 項結果
 台大 : Google約有 
266,000 項結果
 中正 : Google約有 
9,520 項結果
 元智 : Google約有 2,690 項結果