954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Javascript , ajax clock not working properly in Chrome

hi..
i used this code to display a clock.

<script type="text/javascript">
var int=self.setInterval("clock()",1000);
function clock()
{
var d=new Date();
var t=d.toLocaleTimeString();
document.getElementById("apDiv1").innerHTML=t;
}
</script>

in firefox it displays like this 7:25:00 PM
and in Chrome 19:25:39
i want to show a similar clock as in firefox in Chrome. How can i change it?

Virangya
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

mmm i was seeking an easy solution than hard cording.

Virangya
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

What Chrome version are you using? It could be a bug as http://code.google.com/p/chromium/issues/detail?id=3607

Also, you should be able to format your own display. Don't use their default toString() as you are using now.

Taywin
Posting Virtuoso
1,727 posts since Apr 2010
Reputation Points: 229
Solved Threads: 239
 

ok thanxx!~

Virangya
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

function clickCheck(obj,rbselfcollection)
{
if (rbselfcollection.checked) {

}
else
alert("First CheckSelf-Collection by User at");
}

i am using onmousedown="clickCheck(rbself1,rbselfcollection) in the calling radiobutton tag.

This code is working fine in IE.....how can i change it to Firefox Browser? can any one pls assist?

muralikrishna12
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

Next time, please do not high jack other's post. You could create a new one for your question.

To answer your question, could you post your HTML portion of the function call? Currently, it seems that you pass in wrong variables. In IE, it may handle differently (in a non-standard way).

Taywin
Posting Virtuoso
1,727 posts since Apr 2010
Reputation Points: 229
Solved Threads: 239
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: