Does your current host allow you to use .htaccess? If so, you shouldn't have a problem. Even if not, you can still redirect without using JavaScript.
Put the following into your .htaccess (if you can use it):
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^.*myoldsite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mynewsite.net/$1 [R=301,L]
Obviously, change the address of the two site names in the above.
In addition, your index page should look something like the following:
HTML Code:
HTTP/1.1 301 Moved Permanently
Location: http://www.example.org/
Content-Type: text/html
Content-Length: 174
<html>
<head>
<title>Moved</title>
</head>
<body>
<h1>Moved</h1>
<p>This page has moved to <a href="http://www.example.org/">http://www.mynewsite.net</a>.</p>
</body>
</html>