473,387 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

calling link in other frame

Hi,

I would like to call a link in a frame every second but with a different GET
parameter to recognize the time, how long a user has been on the page, i
did this with following script:

<html><head>
<script language="JavaScript" type="text/JavaScript">
var start = new Date();
function time()
{
var now = new Date();
seconds=parseInt((now.getTime() - start.getTime()) / 1000);
parent.nullframe.location = "nullframe.php?email=<?php echo
$_SESSION['email'] ?>&duration=" + seconds + "";
setTimeout("zeit()", 1000);
}
</script>
</head>
<body onLoad="time();">
</form></body></html>

The error console gives no errors, so it seems to be good but somehow it
loads the page once only and the setTimeout("zeit()", 1000); call doesn't
seem to call
Dec 18 '07 #1
2 1365
Ron Eggler said the following on 12/17/2007 7:47 PM:
Hi,

I would like to call a link in a frame every second but with a different GET
parameter to recognize the time, how long a user has been on the page, i
did this with following script:
No DOCTYPE.
<html><head>
<script language="JavaScript" type="text/JavaScript">
Drop the deprecated language attribute and keep the comical type
attribute. Validating would have let you know that.
var start = new Date();
function time()
{
var now = new Date();
seconds=parseInt((now.getTime() - start.getTime()) / 1000);
parent.nullframe.location = "nullframe.php?email=<?php echo
$_SESSION['email'] ?>&duration=" + seconds + "";
Don't post PHP code. Post the HTML the browser gets.
setTimeout("zeit()", 1000);
Where is the function zeit() defined?
}
</script>
</head>
<body onLoad="time();">
</form></body></html>

The error console gives no errors, so it seems to be good but somehow it
loads the page once only and the setTimeout("zeit()", 1000); call doesn't
seem to call
Probably because it isn't defined in the code you posted.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 18 '07 #2
In comp.lang.javascript message <MME9j.131$pY1.33@pd7urf2no>, Tue, 18
Dec 2007 00:47:40, Ron Eggler <NO*****@example.composted:
>seconds=parseInt((now.getTime() - start.getTime()) / 1000);
You should use Math.floor, not parseInt, there. Or you could use |0.
The two .getTime() are OK but superfluous.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Dec 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Twinkletoes | last post by:
Hello people, my first post here... *wave* I need to know how to call a function in a different document. At the moment I've tried onFocus but I'm kinda in over my depth. Perhaps if I tell you...
3
by: Dennis M. Marks | last post by:
I have a function that displays a list extracted from a table using document.write. In the displayed list I want to have a link that will call the same function but display the list in reverse. ...
36
by: Peter Brause | last post by:
Hello, my stylesheet shows different colors for visited, active and hovered links. It works fine in IE 6, but in Opera 7 the color for the active link (red background) is never shown. How to...
1
by: Aki | last post by:
Hi! I've been trying to create a home link in a document that is shown in a frameset of two frames. My aim is to show the first documents that were shown in the frames when the frameset was...
5
by: imaband | last post by:
Hi, I've got a little Quizzer program that asks a question in the upper frame of a frameset and then lists the answer in the lower frame. Answers can be plain text, straight html, a sound, or a...
3
by: Tim Streater | last post by:
I have, as it might be, this in a frame: <a href="mystuff.html">Click here</a> When I click the link, it loads mystuff.html into the frame, whereas what I want is to replace the whole window...
6
by: zino | last post by:
my web application consist of 3 frames :top, left and right, and I use form authentication to authenticate users in ASP.NET 1. the right frame is where the data is displayed I set the default page...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
15
by: dspfun | last post by:
Hi, Is it possible to print the function name of the calling function? For example, f1() and f2() both calls f3(), in f3() I would like to print the name of the function calling f3() which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.