JavaScript: object Date & window.open

 
Post new topic   Reply to topic    Webmaster Forum -> Programming Languages -> Javascript
Cheapez
Guest




Gender: None specified

PostPosted: Wed May 09, 2007 9:28 pm    Post subject: JavaScript: object Date & window.open
View Single PostView Single Post

JavaScript: object Date & window.open

Hello World ^_^
I just start to know about javascript, about object Date, I don't know how to make "second" display or show up all times, To do that, I have to refresh

                                 
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
   <head>
   <meta http-equiv="content-type" content="text/html; charset=UTF-8">
   <meta name="generator" content="PSPad editor, www.pspad.com">
   <title></title>
   </head>
   <body>
    <script language="JavaScript">
     time = new Date();
     var day;
     switch (time.getDay() ) {
      case 0: day="thứ 2";
       break
      case 1: day="thứ 3";
       break
      case 2: day="thứ 4";
       break
      case 3: day="thứ 5";
       break
      case 4: day="thứ 6";
       break
      case 5: day="thứ 7";
       break
      case 6: day="chủ nhật";
       break
     }
     with (document) {
      writeln("Hôm nay là "+day+"<br>");
      writeln("ngày "+time.getDate()+"."+time.getMonth()+1+"."+time.getFullYear()+"<br>");
      writeln(time.getHours()+":"+time.getMinutes()+":"+time.getSeconds()+"<br>");
      writeln(time.getTime());
     }
    </script>
 
   </body>
 </html>




One more thing, I want to have the image automatic open and the size of the indow open with the same size of the image, don't know how, need help

                                 
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
   <head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
   <meta name="generator" content="PSPad editor, www.pspad.com">
   <title></title>   
 
   </head>
   <body>   
    <script language="javascript">
    width=screen.availWidth;
    height=screen.availHeight;
     function zoom(name) {
      okno=window.open ("","zoom",
      "toolbar=no,location=no, directories=no, status=no, menubar=no"+
      ",scrollbars=no, resizable=no, copyhistory=no");
      with (okno.document) {
      writeln('<html>\n<body onClick="window.close()">\n<center>');
      writeln('<img src="zoom_'+name+'.jpg">');
      writeln('</center>\n</body>\n</html>')
      }
      }
     
    </script>
    <img src="vtc.jpg" name="vtc" onClick="zoom(name)">
    <img src="vtc2.jpg" name="vtc2" onClick="zoom(name)">
   </body>
 </html>
 
ADs
robot
Display posts from previous:   
Post new topic   Reply to topic All times are GMT
Page 1 of 1