0

Hello,
I am somewhat new to JavaScript, 2 weeks ago I started.
I have learnt the basics such as

alert('example')

and

confirm('example')

also,

prompt('example','')

But, in the end, playing around with

<HEAD>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
alert('HELLO')
</SCRIPT>
</HEAD>

Gets boring, along with the others, even asking you to type your name, then it says on the page with document.write stuff such as "Hello (yourname)
So, I've decided to go a bit further with my code, and wanted to create a more advanced code script, which, actually is a JavaScript file that will activate when the user has been on the page for XXX number seconds.
The file is a .js extention file, that will be activated. And also I would like to make another .js file, and in that file, I would like a redirect script, because they will be just veiwing the page, then I would like a message saying text such as "Your Veiwing time has Expired, would you like to register? <-- YES/NO CHECKBOX WITH SUBMIT BUTTON -->"
Then it will redirect to a register screen if they selected "YES", which is the bit were the file opens up. And if they selected "NO" A message saying along the lines of "Thank-you for your time." Then after 10 seconds it will direct back to the home of the site.

Thank-you so much for helping- Matthew N.

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Taywin
1

Do you want someone to code that for you? or are you stuck somewhere trying to put your plans into action?

0

Im stuck with the redirect bit, also, I cant get a script to display for a set amount of time.

0

Which one are you talking about, redirect or set display time? To redirect, you may use window.location="<your_url_goes_here>"... If you want to sleep/wait before you invoke another function, you can use setTimeout("functionName(arg1, arg2, ...)", timeInMilliseconds) to do the delay where functionName(arg1, ...) is the function to be called after timeInMilliseconds has passed.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.