Solved

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

Posted on 2011-02-23
5
682 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery on click requires double click 6 29
Link not working 6 42
Timer on div 5 24
how to customize the text in the legend in highcharts 3 31
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

756 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