Saturday, May 31, 2008

I want to use javascript to redirect my website s users to another site which I am affiliated with.
At present whenever I save the page- it shows error msg. Can you help tell whats wrong? tnks. Script is below.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<!-- begin javascript redirect for javascript 1.1
window.location.replace("http://www.website.com/?affid=162") ;
// end javascript redirect for javascript 1.1-->
</script>
<script language="javascript">
<!-- begin javascript redirect for javascript 1.0
window.location.href = http://www.website.com/?affid=162;

// end javascript redirect for javascript 1.0-->
</script>
</head>

<body>
One moment please . . . Your page is loading
<meta http-equiv="REFRESH" content="0;url=http://www.website.com/affid=162">

</body>
</html>

In Javascript- I have to do a function when the mouse clicks anywhere on the page. How do I do that?

Your useless parenting and awful kids are fast becoming world famous...
http://news.bbc.co.uk/player/nol/newsid_7310000/newsid_7319900/7319916.stm?bw=bb&mp=wm&asb=1&news=1&ms3=22&ms_javascript=true&bbcws=2#
(Front page of Time magazine no less)

But there is something that really puzzles me...

Your average middle class parent is happy for their teen to:

Go out on a Friday night dressed like a slut.
Smoke cannabis (admittedly middle class parents are starting to panic about skunk ).
Go to wild parties knowing that they mostly consist of binge drinking and shagging .**
Watch adult TV programmes with sexual themes.

Yet what seems to panic them most is that their little darlings are being overworked at school with too much homework and too many tests.

Could things be more backwards? No wonder you have the highest rates of teen pregnancy- drug/alcohol abuse in Europe and such awful educational standards:
http://www.independent.co.uk/news/education/education-news/reading-and-maths-standards-falling-in-britain-says-oecd-762805.html
**Two on my female work colleagues (I m coming to the end a 12 month posting here) were telling me that they would be happy for their daughters- 12 & 13- to have sex "as long as they used protection".

I want to display the same website address on address bar when I browse any part of that website.
For example I am using "www.sample.com"- when Iam click the link www.sample.com/home.aspx- the address bar shows the I need the same "www.sample.com" on address bar instead of "www.sample.com/home.aspx"
I expect answer except the following
1. Frames & IFrames

Doh! You either have javascript turned off or an old version of adobe s flash player.

i already update my adobe s flash player and turn on the javascript but i cant still watch videos in crunchyroll. can anyone help me?

I m still learning- so I compiled a useless code from some of the things I ve learned.

<style type="text/css">
<!--

body {background-color: black}
.font1 {font-family: tahoma; font-weight: bold; font-size: 10px; color: white;}

-->
</style>

<script type="text/javascript">
<!--

var question = "What would you like the title to be?";
function displayquestion(){
document.title = prompt(question);
}

// -->
</script>

<form>
<input type="button" value="Change Title"
onclick="displayquestion()">
</form>

<script type="text/javascript">
<!--

if (displayquestion() == "Random") {
document.write("<font class= font1 >Good choice.</font>");
}else{
document.write("<font class= font1 >Bad choice.</font>");
}

// -->
</script>


There are two problems (neither of which appear in the error console of Firefox). The prompt still appears on the page when you load it- even though it s in a function. Then- the if statement doesn t work right. It writes "Bad Choice" no matter what.
There was no more room left- so I couldn t provide any more information on the code.

When you load the page- all that should appear from the page from the start is the black background and the button. When you click the button- a prompt appears. Whatever you put in this prompt becomes the page title. If the page title you entered is the word Random- then text should appear "Good choice"- and if you type anything else- the text "Bad choice" should appear.

The two problems are that the prompt opens as soon as the page loads- before anything is clicked. It s only supposed to open upon clicking the button. The other problem was with the if-statement.

No comments: