PDA

View Full Version : JavaScript remote file redirect



BarryM
09-24-2006, 10:22 AM
Hi,
I wonder if anyone knows if there is a way to
use a JavaScript redirect across a number of
pages using a call from a remote file.

I have tried this method without success:
Create a .js file called myfile.js containing this script.
<script type="text/JavaScript">
<!--
setTimeout("location.href = 'http://www.newpage.com';",1500);
-->
</script>

Insert this script into the head tags of the web page:
<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT"
SRC="myfile.js">
<!--
//-->
</SCRIPT>

I wonder if I am trying to do the impossible?

Thanks,
Barry.

BarryM
09-24-2006, 11:18 AM
Hi,
Sorry I missed out on the aim of the exercise.
I thought by withholding/uploading the remote .js file
I could effectively control redirects.

Thanks,
Barry.

Twey
09-24-2006, 03:08 PM
It's not a good idea. Use an HTTP redirect instead.