We help IT Professionals succeed at work.
Get Started

How do I open a new window containing no default browser header information and have it replace the window of the calling page.

349 Views
Last Modified: 2012-05-12
Is there a way to open a page in a new window with the new window having the default header information (navigation arrows, editable address bar, refresh button, menu, toolbar etc.)
removed and have this new window replace the calling window.


Index.cfm
------------
<script type="text/javascript">
    <!--- If javascript is enabled, then redirect to the actual site --->

    var win = window.open('FirstPageOfApp.cfm', '', 'width=850, height=850, channelmode=no, directories=no, fullscreen=no, location=no, menubar=no, resizable=yes, scrollbars=yes, status=yes, titlebar=no, toolbar=no', 'true');

    win.focus();
</script>

<noscript>
    <!--- Javascript is not enabled so display a message and stop --->

    JavaScript is turned off and/or pop-ups are being blocked in your web browser. Javascript must be turned on and pop-ups must be allowed for this site to run this program.

</noscript>



FirstPageOfApp.cfm
-------------------------
<h1>This is the first page of the app.</h1>


Script Index.cfm (above) calls page FirstPageOfApp.cfm (above) by executing window.open(). A new window opens and page FirstPageOfApp.cfm is displayed in the new window with none of the default header information (navigation arrows, menus, toolbars, etc.) displayed except a read-only address bar.
Page Index.cfm stays open and is just a blank page with the default header information displayed.
The result is that 2 pages are now open; Index.cfm (with the default header information) and FirstPageOfApp.cfm with a read-only address bar.

Is there a way to have Index.cfm call FirstPageOfApp.cfm and have FirstPageOfApp.cfm be the only page open as a result of the call (i.e. FirstPageOfApp.cfm somehow replaces Index.cfm or closes Index.cfm without the "the webpage is trying to close" prompt to the user)?

I am trying to have the result be: page FirstPageOfApp.cfm is the only page displayed and it has only the read-only address bar displayed.

Comment
Watch Question
Top Expert 2013
Commented:
This problem has been solved!
Unlock 2 Answers and 2 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE