www.webdeveloper.com
Results 1 to 2 of 2

Thread: body onload ... popup window

  1. #1
    Join Date
    Oct 2012
    Posts
    3

    Question body onload ... popup window

    hi

    1) trying to make this script work:

    Code:
    <script type="text/javascript">
    var tmp='<html><head><title>popup</title>';
    tmp+='<script type=text/javascript>';
    tmp+='function nowTime(){';
    tmp+='var oNowTime=new Date();'; 
    tmp+='var iMonth=oNowTime.getMonth();';
    tmp+='var iDate=oNowTime.getDate();';
    tmp+='var iYear=oNowTime.getFullYear();';
    tmp+='var iHours=oNowTime.getHours();';
    tmp+='var iMinutes=oNowTime.getMinutes();';
    tmp+='var iSeconds=oNowTime.getSeconds();';
    tmp+='var iMilliSeconds=oNowTime.getMilliseconds();';
    tmp+='var sNowTime=iHours+":"+iMinutes+":"+iSeconds;';
    tmp+='return sNowTime';
    tmp+='}';
    tmp+='function nowDate(){';
    tmp+='var oNowTime=new Date() ';
    tmp+='var iMonth=oNowTime.getMonth()+1';
    tmp+='var iDate=oNowTime.getDate()';
    tmp+='var iYear=oNowTime.getFullYear()';
    tmp+='var iHours=oNowTime.getHours()';
    tmp+='var iMinutes=oNowTime.getMinutes()';
    tmp+='var iSeconds=oNowTime.getSeconds()';
    tmp+='var iMilliSeconds=oNowTime.getMilliseconds()';
    tmp+='var sNowTime=iYear+"-"+iMonth+"-"+iDate;';
    tmp+='return sNowTime';
    tmp+='}';
    tmp+='function showNowTime(){';
    tmp+='var oObjId1=document.getElementById("mdate");';
    tmp+='oObjId1.innerHTML=nowDate();';
    tmp+='var oObjId2=document.getElementById("mclock");';
    tmp+='oObjId2.innerHTML=nowTime();';
    tmp+='setTimeout("showNowTime()",1000)';
    tmp+='}';
    tmp+='<\/script></head><body onload="showNowTime()">';
    tmp+='<font size="7">';
    tmp+='<div id="mdate">mdate</div>';
    tmp+='<div id="mclock">mclock</div>';
    tmp+='</font></body></html>';
        var newwindow2=window.open('','name','height=200,width=150');
        newwindow2.document.write(tmp);
    </script>
    any suggestions are welcomed.

    2) What is the best way to learn web-developing (javascript, vb script...etc) online?


    thanks

  2. #2
    Join Date
    Apr 2011
    Location
    I live in the pinaple under the sea
    Posts
    107
    On your question #2..
    The two language that you wrote are just a scripting language that will run on a client side (Browser Side)

    Web Application are commonly compose of common approach (Client --> Server)
    For client side its good to use jquery, its basically a javascript framework (Meaning the core language is javascript).
    javascript do all client side process such as form validation, modifying UI and css of your page, etc

    for server side application, if you want free go to PHP but if you have money and you can pay go to asp.net
    Server side application process on the server side when it is needed to process information that is came from the client such as saving information you get from the client to a database

    If you use PHP use mysql as your database server or if asp.net go to MSSQL.


    For your question #1 thee is a counterpart code for jquery and its more easy to implement please google jquery colorbox
    Last edited by coldfire421; 11-19-2012 at 08:58 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles