Solved

javascript, how to redirect (from index.html page) but does not show url of the new page

Posted on 2011-02-23
5
683 Views
Last Modified: 2012-05-11
How to redirect (from index.html page) but does not show url of the new page
For example, type in the domain (e.g. http://testwebpage.com)  this takes  me to my index page, which I want to redirect somewhere else.  However I don't want to see the new url on the browser.
My code so far:

<script language="JavaScript">
function redirectToNewPage(){
  location.href="/dir1/newpage.html";
}
</script>

</HEAD>
<BODY bgcolor="black" text=white onLoad="redirectToNewPage()">
</BODY>
</HTML>

0
Comment
Question by:rgbcof
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 34966224
do you have the control of the index page ?
0
 
LVL 4

Accepted Solution

by:
LAMASE earned 250 total points
ID: 34966252
You can empty the current dom and insert an iframe with src="theotherpage".
Why do you need to hide an url?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 34966265
This is you index.php :


<?PHP
   $content = file_get_contents("/dir1/newpage.html");
   echo $content;
?>

Open in new window

0
 
LVL 12

Expert Comment

by:Amick
ID: 34967301
No need to use JavaScript . Try
<html>
<head>

</head>
<body>
<object type="text/html" height="100%" width="100%"
data="http://www.experts-exchange.com/">
</object>
</body>
</html>

Open in new window


or
<html>
 <head>
 <title>OBJECT</title>
 <frameset cols = "100%">
 <frame src="http://www.experts-exchange.com" />
 </frameset>
 </head>
 <body>
 </body>
 </html>

Open in new window


0
 

Author Closing Comment

by:rgbcof
ID: 34971852
It turns out the an iframe is the best solution.  The url never divulge any path below  it.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question