Getting Iframe content in Javascript

November 6, 2009 by manikandanmv

Iframe is an inline frames, allow you to load the separate html file into an existing document. You can also load the file dynamically with “src” attribute. Suppose there is a need to get the iframe content and process it using javascript. The following example helps you to do it and this has been a cross browser solutions for Firefox & IE browsers.
Let’s load a simple html file inside the iframe, and get that file content with javascript method getIframeContent.

GetIframeDetails.html


<html>
 <body>
 <iframe id="testFrame" src="FrameContent.html" >
 </iframe>
<a href="#" onclick="getIframeContent('testFrame');">Get the content of Iframe</a>
 </body>
<script>
 function getIframeContent(frameId){
 var frameObj = document.getElementById(frameId);
 var frameContent = frameObj.contentWindow.document.body.innerHTML;
 alert("frame content : "+frameContent);
 }
 </script>
 </html>
 

FrameContent.html


<html><body>
 <div id="testFrameContent" style="border:1px;">
 This is simple HTML file which is loaded inside the iframe.
 </div>
 </body>
 </html>

what getIframeContent method do?


function getIframeContent(frameId){
 var frameObj = document.getElementById(frameId);
 var frameContent = frameObj.contentWindow.document.body.innerHTML;
 alert("frame content : "+frameContent);
 }
  • getElementById(frameId) – get the object reference of iframe
  • contentWindow – is a property which returns the window object of the iframe
  • contentWindow.document – returns the document object of iframe window.
  • contentWindow.document.body.innerHTML – returns the HTML content of iframe body.

You can also access any tag element’s inside the iframe. This can be done by processing with tag names/ids. Let’s imagine the use case: to retrieve the content of div element inside the iframe. Below statement will retrieve it.

frameObj.contentWindow.document.getElementById(“testFrameContent”).innerHTML

Blogs about dynamically change the iframe heights.

http://manikandanmv.wordpress.com/2009/05/25/version-2-dynamically-change-iframe-heights/
http://manikandanmv.wordpress.com/2009/04/25/dynamically-change-iframe-heights/

Shortcut keys for Windows Control Panel

October 30, 2009 by manikandanmv

The following shortcut keys are more useful to quickly access the control panel applets.

Go to Window Start Menu -> Click Run and then type your required applet shortcut key. (Or) Just press windows button + r in the keyboard, a Run window will prompt, here you can enter the corresponding applet shortcut key.

Control Panel Applet Name
Shortcut Key
Accessibility Options access.cpl
Add New Hardware Wizard hdwwiz.cpl
Add/Remove Programs appwiz.cpl
Date and Time Properties timedate.cpl
Display Properties desk.cpl
FindFast findfast.cpl
Internet Properties inetcpl.cpl
Joystick Properties joy.cpl
Keyboard Properties main.cpl keyboard
Mouse Properties main.cpl
Network Properties ncpl.cpl
Password Properties password.cpl
Phone and Modem options telephon.cpl
Power Management powercfg.cpl
Regional settings intl.cpl
Scanners and Cameras sticpl.cpl
Sound Properties mmsys.cpl sounds
Sounds and Audio Device Properties mmsys.cpl
System Properties sysdm.cpl
User settings nusrmgr.cpl
TweakUI tweakui.cpl

 

 

Enabling Tomcat Access Logs

October 24, 2009 by manikandanmv

Add the following code snippet in the file $CATALINA_HOME/conf/server.xml. This will creates log files to track client access informations such as user session activity, user authentication information, page hit counts.

<Valve className=”org.apache.catalina.valves.AccessLogValve” directory=”logs”
prefix=”localhost_access_log.” suffix=”.txt” pattern=”common” resolveHosts=”false”/>

The code snippet states that the log file ‘localhost_acess_log.txt’ will be placed under $CATALINA_HOME/logs directory.

Restart the tomcat, its working.

Debugging Java Applications with NetBeans

September 24, 2009 by manikandanmv

Netbeans provides an easy environment for debugging or troubleshooting your Java applications. With netbeans debugger, you can step through the code line by line while viewing status of variables, threads and other informations.  No need to add println() statements for finding problems that occur in your apps. Instead use breakpointss
Following things you can perform with Netbeans debugger

  1. step through application code line by line
  2. step through JDK source code.
  3. using break points, execute specific parts of code at a time
  4. track the value of a variable/expression.
  5. fix code on the fly and apply those code changes and continue the debugging session.
  6. options to suspend threads/execution at an exception.
  7. step back to the beginning of a previously called method. (pop a call in the current call stack).

Java Platform Debugger Architecture

It has 3 layers, which provides the infrastructure for debugging applications.

java platform debugger architecture

Layer-1: high-level interface for debugging

Layer-2: format of information transfer

Layer-3: low-level native interface, applies code changes at jvm level.

Debugger Parameters

Netbeans debugger allows you to enable remote debugging to already running Java application. For this, you must run your application in debug mode, which requires below parameters.

-Xdebug -Xrunjdwp:transport=dt_socket, server=y, address=<<port number>>, suspend=n

Example:

java -Xdebug -Xrunjdwp:transport=dt_socket, server=y, address=65535, suspend=n

Parameter
Description
-Xdebug enables the application to be debugged.
-Xrunjdwp loads the reference implementation of the JDWP(Java Debug Wire Protocol), which enables remote debugging
transport name of the transport to be used when debugging the application.dt_socket for a socket connection.
server y – application listens for a connection at the specified address.
n – application attempts to attach to a debugger at the specified address.
address specifies a port number used for communication b/w the debugger and application.
suspend n – application starts immediately.
y – application waits until a debugger has attached to it before executing.

Java Debug Wire Protocol(JDWP) – which defines the format of information and requests transferred  between debugged application and debugger.

Attaching the Debugger to a running application.

From the main menu, select Debug -> Attach Debugger

debug-mainmenu

Below window will pop-up.

attach_debugger

Connector - select the appropriate connection type.
Transport – specifies JDPA transport protocol – automatically filled based on connector.
Host – Machine where the debugging application is running.
Port – Port number that the application listens on.
Timeout – durations that the debugger waits for a connection to be established.

Debugger commands.

Commands for debugging a java app.

F7 – step into – executes each source line , if it has method call, and source code is available, pointer moves to that method and executes it. otherwise pointer moves to the next line in the file.
F8 – step over – executes each source line without stepping through the individual instructions/commands.
F4 – run to cursor – execute the program from the current line.
F5 - continue – resumes debugging until it reaches a next breakpoint or exception or until the program terminates normally.

Setting Breakpoints

Breakpoint is a marker that you can set to specify where execution should pause when you are running your application in the IDE’s debugger.
with breakpoints you can,

  • monitor the values of variables
  • take control of program execution by stepping through code line by line.
  • detect when an object is created.
  • detect when the value of a variable is changed.

Fixing code during a debugging session.

Apply Code Changes – Its an useful feature. This can save lot of time, otherwise waiting for source to be rebuilt and restarting the server/debugging session.
It is useful for

  • Fine-tune the code.(fixing minor issues)
  • change the logic within a method.

This does not work for the following changes.

  • add/remove methods or fields
  • change the access modifiers of a class, method , field
  • refactor the class hierarchy.

In simplest form, It should not accept the skeleton changes.

Note : Once restarted the server, applied code changes are not taking effect for next time because “Apply code changes” works on particular jvm instance only

For fixing code on the fly while debugging session, you must attach your application source code and jar files properly.

Advantages of using debugger

  • Easily and quickly find and resolve the problem.
  • Understand the flow of your application code is easier

Inspirational Book 2 : Who will cry When you die?

September 10, 2009 by manikandanmv

Had a chance to read this book, from the popular author Robin Sharma. Overall it was a nice book and I learned lots of points from the book.

Usually every person have liked some points from each book they have read. Likewise am going to share points which inspired me in this book. The book has 101 topics, among these I personally experienced that below points are good to keep/follow in your life.

Get Up Early
It would become a great day if you wake up early everyday. Sometimes back, I was woke up at 5 o clock for a month. During this period, I personally felt my mind was more clear, more active, and the power of wisdom has increased. I have been watching people who are waking up early, they are more active, have good health and have clear thoughts when comparing with people waking up late.

Master Your Time
It is a nice quote and moreover all people should practice it without saying don’t have time. Commit yourself to manage your time more effectively.
I can say if you follow the principle “Get Up Early“, surely you will manage your time perfectly and also you will get more time to think about yourself.

List your problems
A problem well stated is a problem half solved - Charles Kettering.
It was a nice quote, really I liked it.
Most of the problems disappear when you list down the problems or you can share to your best friends, after that you might be feel peaceful.

Keep Your Cool

Anyone can become angry – that’s easy. But to be angry with the right person, to the right degree, at the right time, for the right purpose, and in the right way – that’s not easy ~ Aristotle.

One of my favorite one.

In my surroundings, I have been seeing people who are getting tensed quickly. They lose their temper frequently and it becomes a habit. Oops, my friend lend this book(thanks to her) sometimes she behaves like a short tempered person. That’s why I keep saying don’t get anger for simple things unnecessarily.
Robin strategy to control the temper, really a good one.
Three Gate Test.

  1. Are these words truthful?
  2. Are these words necessary?
  3. Are these words kind?

If you pass these 3 tests, then you can deliver your words boldly.

Plant a Tree(Live a Fulfilling Life)
Three things to do, to live a fulfilling life

  1. have a son
  2. write a book
  3. plant a tree

these 3 legacies will live long after you die.
By the way, I would add one more thing in the list, having a daughter. Because I love father-daughter relationship, I am not yet into that level yet I feel it has to be nice one. Eventually Robin also had mentioned the same.

One more thing I have to say here, I have a plan to write a book titled “The Power of Observation” but don’t know when it will be published, probably you can expect it in few years.

Find 3 Great Friends
I won’t limit/resist with number 3, because I have the habit of making new friends irrespective of gender. This should help to find more happiness and joy in your life.

Get Good at Asking
He who asks may be a fool for five minutes. He who doesn’t is a fool for a lifetime. ~ chinese proverb
This proverb perfectly suits my character. Till now I never hesitated to ask my needs/wants whether I get it or not. The person who asks at least has a chance of getting what he wants, the person who does not ask has no chance.

Keep a Journal
You can record your daily activities. It helps to promotes your growth and wisdom by analyzing and evaluating them.

Talk to Yourself
Keep saying your mantras(your goal, want to be like this) to yourself daily. These mantras will pave a clear path for your target, also which would help to avoid negative thoughts/wrong redirection in life. This works well for me.

Take More Risks
-
the more risks you take, the more rewards you will receive.
Don’t resist yourself with the same path, do things which are uncomfortable/you fear. Human minds are refusing the change, always preferred to stay in comfort zone. Be bold to come out and take more risks in your life.

Don’t pick up the phone every time it rings
I must follow this. Oh god, I want to keep this statement in mind : telephone is there for your convenience, not for the convenience of your callers.

After reading this book, I became a big fan of Robin Sharma. Going to ask another book from my friend. Hope she will give one.

Version 2 : Dynamically change IFrame Heights

May 25, 2009 by manikandanmv

This is a continuation of my previous blog. Dynamically change IFrame Heights – here loaded a static HTML content on iframes.
In version 2, we have loaded dynamic files inside the iframes. At the same time we have to dynamically change the height of iframes based on their loaded file content.

Sample Code

Below code works well in both browsers Firefox & Internet Explorer.

<html>
<body>
<script>
function setIframeHeight()
{
    var elt = document.getElementById('testIframe');
    if(elt.contentWindow){
        document.getElementById('testIframe').height = elt.contentWindow.document.body.scrollHeight + 30;
    }
}
</script>

<iframe src="http://manikandanmv.wordpress.com/ajax.html" name="testIframe" id="testIframe" onload="setIframeHeight();" />
</body>
</html>

contentWindow

  • returns an window object of the iframe.

scrollHeight

  • is a property which returns the scrolling height of the object.
  • the value specifies only the visible height of the object.

elt.contentWindow – returns the object of IFrame window.
elt.contentWindow.document – returns the object of HTML document.
elt.contentWindow.document.body – returns the object of HTML body element.

You may also use contentDocument property for getting height of iframe. This will work only in Firefox. Since IE6.0 or 7.0 does not support this property. This has been supported from IE version 8.0

Sample code for doing the same in Firefox with contentDocument

if(elt.contentDocument){
elt.height = elt.contentDocument.body.offsetHeight+40;
}

contentDocument

  • returns an object of iframe document.

offsetHeight

  • is a property used to retrieves the height of the element/object in pixels.
  • this value includes the height of elements borders + padding.

How to open Ajax Page in Browser New Tab

May 18, 2009 by manikandanmv

It’s not easy task to support both “Load a web page using Ajax” and “Allow to open the same page in browser new tab”. Because we have to manually handle the second option. Let’s see how to solve this task.
Before proceeding, first you have to know why ajax web pages are not able to support the second option.
Reason : when you click a web page link, it will just invoke a javascript method specified in onclick event which loads the page through ajax requests. So here “href” attribute of anchor tag is either empty or “javascript:void(0);”. Due to this we are not able to open the page in new tab.

Sample code for achieving both the actions

  • ajax page load
  • the same page should be able to open in Browser New Tab by using “Open Link in New Tab” option.

Two operations handled in the web page links(anchor tags),

  • invoke the method showPage when u click the link. which means simply onclick event gets fired.
  • if u open the same link in new tab, the below sequence of actions will execute.
    • # part of href(say, #/blogs/JSON/json-basics.html) has appended to the browser url
    • showtab method has invoked beco’z the main page gets loaded. rest will take care of the method showtab

main page should be like this.

<html>
<body>
<a href="#/blogs/JSON/json-basics.html" onclick="showPage('/<span style="color:#000000;">blogs</span><span style="color:#000000;">/JSON/json-basics.html');">JSON Basics</a>
<a href="#/</span><span style="color:#000000;">blogs</span><span style="color:#000000;">/ajax/ajax-basics.html" onclick="showPage('/</span><span style="color:#000000;">blogs</span><span style="color:#000000;">/ajax/ajax-basics.html');">Ajax Basics</a>
<a href="#/</span><span style="color:#000000;">blogs</span><span style="color:#000000;">/html/html-basics.html" onclick="showPage('/</span><span style="color:#000000;">blogs</span><span style="color:#000000;">/html/html-basics.html');">HTML Basics</a></span>

<span style="color:#000000;">
<div id="showhelp"></div>
<!-- This div is the Common Dynamic Area, this area gets changed based on clicking the above link --></span>

<script>
showtab();
<!-- this method gets executed everytime when a page loads.
what this method does,
just get the full url from the browser address bar.
parse the url and get the exact "new page url" which is available after the symbol "#"
and send the "new page url" via ajax request.
-->

function showtab()
{
var url = document.location.href;
var index = url.indexOf("#");
var taburl = "";
if(index>0){
var taburl = url.substring(index+1);
}
sendAjaxRequest(taburl, "showhelp");
}

function showPage(url)
{
sendAjaxRequest(url,"showhelp");
}

function sendAjaxRequest(url, divid)
{
var req = <a href="http://manikandanmv.wordpress.com/2008/09/29/ajax-example">getXMLHttpRequest</a>();
req.onreadystatechange = function(){ processResponse(req, divid) };
req.open('GET', url, true);
req.send(null);
}

function processResponse(req, divid)
{
if (req.readyState == 4) {
if (req.status == 200) {
document.getElementById(divid).innerHTML=req.responseText;
}
}
}

</script>
</body>
</html>

Are you new to Ajax..? Read the below posts for learning basics.

Ajax Basics – http://manikandanmv.wordpress.com/2008/09/23/ajax-asynchronous-javascript-and-xml/
Ajax Example – http://manikandanmv.wordpress.com/2008/09/29/ajax-example/

Dynamically change IFrame Heights

April 25, 2009 by manikandanmv

With script you can able to change/set the iframe attribute values dynamically. Sometimes we don’t know the actual height of the web page because page gets loaded dynamically and the height may varies. So here i have to calculate the page content height dynamically and set the same value in iframe height property. Mainly this is required when a page loads dynamically inside the iframe and its height can adjust automatically based on the content.(which means to show iframe without vertical scroll bar).

Sample Code


<html>
<body>
<div id=”showid”>
<table>
<tr><td>
Enter your name <input type=”text” name=”yourname”/>
Enter your age <input type=”text” name=”yourage”/>
<input type=”submit” name=”Submit”/>
</td></tr>
</table>
</div>

<script>
function setIframeHeight()
{
document.getElementById(‘testIframe’).height = document.getElementById(’showid’).offsetHeight;
}
</script>

<iframe src=”" name=”testIframe” id=”testIframe” onload=”setIframeHeight();” />
</body>
</html>

offsetHeight

  • is a property used to retrieves the height of the element/object in pixels.
  • this value includes the height of elements borders + padding.

How it works.?

Browser rendering a page by reading each HTML tags, scripts are loaded first. When the control comes to iframe tag, we have specified an event called onload and the value setIframeHeight() method gets invoked. In this method we get the height of the page which is rendered inside the div element and set the same in iframe height.

Like this you can set the value of any iframe attributes.

document.getElementById(‘testIframe’).width = 100;
document.getElementById(‘testIframe’).scrolling = “yes”
document.getElementById(‘testIframe’).class= “css_classname”;

Inspirational Book : It’s All a Matter Of ATTITUDE

April 17, 2009 by manikandanmv

I got a chance to read a book called “It’s All a Matter Of ATTITUDE” written by Justin Herald. Thanks to my friend to lend me the nice book. In my life i have never read a book like this. I can recommend every people to read this book.

Really surprised.! Because i have already followed some of the points specified in the book in my life. This was a great sync between me and this book. So i was impressed and finished the book at a great pace. Due to this my friend gifted this book to me.

I have an attitude to share my knowledge with my friends/colleagues/peoples around me, hence this blog post. Surely all the points are helpful to improve/enhance your life well.

The book has almost 50+ consolidated slogans about attitudes. But here am going to summarize the points in topic wise which will be helpful for better understanding.

Topics are

  • Positive Attitude
  • Attitude Towards Goal
  • Success Attitude
  • Winners & Losers Attitude
  • Advice
  • Leadership & Ownership

Positive Attitude

  • Positive Attitude = Positive Results.
  • I don’t have an Attitude Problem… You have a Perception Problem
    • The best way to overcome is constantly keep your own attitudes in check.
  • I don’t care how Good you are…. I’m Better!
    • Never compare yourself to others and their results.
    • You are better than the outcomes that you experience. – it just means you are constantly bettering yourself.
  • Its all about your mindset

    • If nothing worked out as u planned, you can still get back on track.
  • 100 % Attitude
    • You will achieve a lot more if you adjust your attitude.
  • If you think you can’t…… You won’t
    • Our thinking plays a huge role.
    • Our thinking will control our actions
    • Our mindset has determined our’s end result.
  • If you think you’re beaten… You are!
    • Keep your mind filled with the positive things around you.
    • Don’t think in -ve way, If u did , the minute you allow a second outcome.
  • Life’s tough… So what!
    • Have an attitude that you CAN.
  • It’s none of my business what you think of me!
    • We all need to block our ears to negative people.
    • Become bulletproof – people around you offer negativity , separate yourself from them and their comments.
  • Be Different…. Be Better.
    • Being excellent is a choice.
    • Have an attitude to try new things, and learn new things day by day.
    • Do things that you have never attempted before.
  • Self-control

    • Make sure you always control your goals, dreams and life.
  • A Positive anything is better than Negative nothing.
    • Focus on the positives and outcomes will come in front of you.
    • Being positive doesn’t mean that everything will always work out the way you plan, but it will help to keep you going in the right direction.
  • No Regrets… Not event a little one.
    • Don’t focus on what you have done wrong. Focus on what you can do right.
    • Regret – negative tone.
  • I preach what I practice.
    • Be an example to all.

Attitude Towards Goal

  • No LIMITS, No EXCUSES, No IF’s , No BUT’s… Just ATTITUDE.
    • There are no excuses in life, there are no limits as to how high you can go.
  • Keep your focus on where you want to go in life.
    • Change your focus to areas that will give results sooner.
    • Focus on areas which you need to improve.

Success Attitude

  • Success is all about the journey.
    • A successful person is measured by how many times they picked themselves up. Not measured by their ultimate outcome.
  • Secrets to Success.
    • Do whatever it takes to succeed.
    • Hardwork, determination and desire.
    • What have you prepared to get where you want to go?
  • 100% Effort
    • Stay focused on your desired outcome and apply 100% effort, your dreams will become reality
  • The EDGE is not the limit….. It’s only the STARTING point.
    • Better you can concentrate on achieving all you desire
    • Enjoy yourself and all that life brings.
  • Have people around you who are enthusiastic about their own success.
    • Being positive doesn’t mean that everything will always work out the way you plan, but it will help to keep you going in the right direction.
  • Risks
    • Take risks, risks are just part of the process towards success.
  • Successful people.
    • They did not focus on obstacles.They used obstacles to make them stronger.
    • They see ‘impossible’ as ‘possible’ . Its all up to you.

Winners & Losers Attitude

  • The Game isn’t over until I win
    • Quitters never win and winners never quit (remember)
    • Life is a game – we only compete with ourselves: our thinking/goals/dreams.
  • Losing is not an option
    • Never think you are a loser, it means your goal is bit longer to achieve.
    • Its all about how you view it really.
  • Winners make it happen… Losers let it happen
    • Don’t let your life happen around you. Achieving is all about controlling the final outcome.
    • Make your successes happen. It’s really up to you.
  • Champion
    • Winners attitude will be the deciding factor.
    • Just change your thinking and start acting like a champion, your results will soon follow.
  • Professional Losers
    • They are just blaming others, blaming their past and blaming those around them.
    • To avoid this never allow your thinking stuck in ‘loser’ mode.
  • Losers says “its all about Luck
  • Losers shortcut is “Quitting“.
  • Winners do everything it takes to reach their goals.

Advice

  • Asking advice to others. (When i want your opinion, I’ll give it to you!)

    • Seek advice from those who have achieved a level of success in your desired field.

Leadership & Ownership

I have already written a blog about Leadership. Read it here

  • Leadership
    • True leaders, will always have people following them.
    • Make sure you lead them to a place they need to go.
  • Ownership
    • Own the process of your success.

Every person have both attitudes (positive & negative). It’s up to you to choose which one and proceed the life in success mode.

Handling Timezone in webclient Timer

March 24, 2009 by manikandanmv

This post is the continuation of my previous post “Showing Timer in webclient”. – i could not handled timezone in my previous code. In detail if you are running a server in one timezone, say US(GMT-08:00)  and you are accessing the server webclient in different machine which has different timezone, say, India(GMT+05:30). So already written code is failed to show the correct server time.
First analyze, what was the problem in previous code:

var time = <%=System.currentTimeMillis()%>
var date = new Date(time);

In the above code, am getting server time in milliseconds and set the same in javascript Date object.
var date = new Date(time) - while executing this line, server will get browser timezone and set that timezone into this date object. Due to this we are getting incorrect server time.

Solution to this problem is by setting year, month, day, hours, minutes & seconds separately to Date class.  Here Date class does not take browser timezone.

<%
Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int date = c.get(Calendar.DATE);
int hrs = c.get(Calendar.HOUR);
int mins = c.get(Calendar.MINUTE);
int secs = c.get(Calendar.SECOND);
%>
var date = new Date(<%=year%> , <%=month%> , <%=date%> , <%=hrs%> , <%=mins%> , <%=secs%> );

For better understanding, once again i put the entire code here with the updated one.

Sample code with Timezone handling.

<div id=”showTimer“></div> <!– Used to show the Digital Timer –>

<%
Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int date = c.get(Calendar.DATE);
int hrs = c.get(Calendar.HOUR);
int mins = c.get(Calendar.MINUTE);
int secs = c.get(Calendar.SECOND);
%>

<script>

var months = new Array(”Jan”, “Feb”, “Mar”, “Apr”, “May”, “Jun”, “Jul”, “Aug”, “Sep”, “Oct”, “Nov”, “Dec”);
function showCurrentTime(){
var date = new Date(<%=year%> , <%=month%> , <%=date%> , <%=hrs%> , <%=mins%> , <%=secs%> );
var showdate = date.getDate() + ” ” + months[date.getMonth()] + ” ” +date.getFullYear() + “, ” ;
var hrs = date.getHours();
var mins = date.getMinutes();
var secs = date.getSeconds();
hrs = (hrs > 9) ? hrs : “0″+hrs;
mins = (mins > 9) ? mins : “0″+mins;
secs = (secs > 9) ? secs : “0″+secs;
var showtime = hrs + ” : ” + mins + ” : ” + secs;
time = time+1000;
document.getElementById(”showTimer“).innerHTML=showdate + showtime;
}
setInterval(”showCurrentTime()”, 1000);
</script>