Javascript Open and Close window

I am creating a new website and am having problems getting
the open window and close window to work. I want this window to
open a new window (NOT a popup window used with the "onload"
option). I am using an img tag so that when you click on the image
thumbnail this new window opens. It is my understanding in order to
use the window.close option, you must have the javascript in the
header of the html document for the close to work. In the heading
of the document that contains the link to open a new window I have
the following:
<SCRIPT language="JavaScript1.2">
function popuponclick()
Cellex = window.open("products/cellex.htm",
"console","status=1,width=350,height=150");
function closepopup()
if(false == cellex.closed)
cellex.close ();
else
alert('Window already closed!');
</SCRIPT>
Then I have this in the body:
<img src="images/thumbnails/dermalogicath.jpg"
alt="Dermalogica" width="94" height="84" border="0"
/></a></td>
<td><a href="products/mdskin.htm"
onclick="window.open('products/mdskin.htm','mdskin',width=610,height=780,scrollbars=yes') ;return
false; target="_blank">
However, I'm getting script errors when opening the window on
the lines in the body Unterminated error. I have tried using the
help in Dreamweaver as well as many docs posted, but still cannot
get this to work. Once I get the script errors resolved, the when
the window opens, it will not close. I get the message that a
window is trying to be closed and do I want to close the window
which closes internet explorer entirely. I'm using IE 7.0 as well
as foxfire and have the same issue on both. If I use the
dreamweaver behaviors to call a javascript, it puts "onload" and if
I change to "onclick" then the script will not work. When I use the
behavior "open window" it still doesn't work. I'm totally lost as
to what I'm doing wrong as I have followed about 10 papers all
using the same instructions.
Hopefully some one can help me, I'm getting fustrated as this
seems to be pretty straight forward.
Thanks, vienie

Try this on for size:
I have included two functions.
windowRebuild() - opens a new window, maximizes it based on the screen size, removes all toolbars, and then closes the old window.
myLocation(appName, pageName) - builds a url referencing an HTMLDB application, specfic to what server you are currently on. Very useful when you have an application on 3 different servers(dev, test, prod servers), you wouldn't want the server name hardcoded if you plan to export the app to another server.
Also, you need to be careful when using &APP_ID. I am not completely certain how that is resolved at runtime, but I've found it only works when the javascript is in the HTML Header of a page and not stored in the template of the page.
<script language="JavaScript1.1" type="text/javascript">
  This functions is for internal application use.
  Examples of myLocation:
  url = myLocation('&APP_ID.', 'APP_PUBLIC_PAGE');
  url = myLocation('MY_APP_ALIAS', 'MY_PAGE_ALIAS');
  url = myLocation('184', '10');
function myLocation(myApp, myPage){
  var myHost = location.host;
  var newURL;
  newURL = 'http://'+myHost+'/pls/htmldb/f?p='+myApp.toString()+':'+myPage.toString();
  return newURL;
/*  Function windowRebuild()
*   This function will open a new window and close the old window.
*   This function will also maximize the new window and remove all toolbars.
function windowRebuild(){
   if(window.name != 'myAppWin'){
    var url = myLocation('&APP_ID.', 'PAGE_ALIAS');
    var myWin = window.open(url,'myAppWin','toolbar=0,scrollbars=1,menubar=0,status=1,resizable=1,location=0');
    window.opener = 'x';
    window.close();
   if(window.name == 'myAppWin'){
    window.moveTo(0,0);
    window.resizeTo(screen.availWidth,screen.availHeight);
</script>Let me know if that works or you need some more explanation.
Chris

Similar Messages

  • Trackpad is presenting a bug to open and close windows, mission control, and to move/roll the application (App) up and down.

    Totally out of the blue, my trackpad is presenting a "bug". Every time that I try to open and close my mission control, or in the moments that I move / roll up and downs the Applications Screen, my Mac freezes for less than a second.
    It never suffered any damage (NEVER!)! I am feeling very frustrated because I have no idea about what could cause such problem.
    My MacBook Air is running OS X 10.9.5.
    Any help will be very welcome!

    Well, it all really depends on the custom program and how it was written. Does it have an ActiveX interface? If it does, than that's the easiest way to go. If you put an automation refnum on the fron panel, you can right click and it and choose Select ActiveX Class>Browse. The browser will list all of the ActiveX type libraries that are registered on your system. If you can find one that refers to your custom program, then you should be able to use it's methods and properties to control. If it does not have an ActiveX interface, then things get much more difficult.

  • Open and close window

    Due to issues getting Google maps to work from within Edge Animate using jquery-ui-map I have resorted to loading a new HTML page containing the map.
    Is there a way that I can open the new window containing the Google map leaving the Edge page behind it and then close the new map window returning back to the Edge file?
    I can open the new window with the map fine but any attempt to close the window has failed. I tried a back button but this reloads the Edge file which is not what I want to do, I also tried self.close() which worked in a browser but after compiling with phonegap it stopped working.
    Can I load the html file into a div?

    Never used it myself, but there is a hack that adds system event sounds.
    http://www.unsanity.com/haxies/xounds
    I'm sure there will probably be issues with it when Snow Leopard comes out, so you may want to wait a few weeks after its release so the developer can address any incompatibilities.
    Mac OS 9 had system sounds, but I personally think Mac OS X is better off without all the noise. About the only ones Apple kept are the general system alert sound (which is useful) and the empty Trash sound.

  • Open and close window sound effects?

    hello, i was wondering if there is a way to have a sound effect play whenever a window opened or closed or i open a file. anything like that? does anybody know where to go to do that stuff? thank you.

    Never used it myself, but there is a hack that adds system event sounds.
    http://www.unsanity.com/haxies/xounds
    I'm sure there will probably be issues with it when Snow Leopard comes out, so you may want to wait a few weeks after its release so the developer can address any incompatibilities.
    Mac OS 9 had system sounds, but I personally think Mac OS X is better off without all the noise. About the only ones Apple kept are the general system alert sound (which is useful) and the empty Trash sound.

  • Help, my iPad working by him selves. It write by it selves and open  and close window uncontrolled

    I Have tried to reset and restore and set it up as new

    If you have tried those three things and the iPad still doesn't work properly I suspect you might have a hardware problem with your iPad. Make an appointment at an Apple Store to have your device examined by a technician. Or contact Apple Support. Be sure to backup your iPad if you can, before taking or sending it to Apple.

  • Trackpad playing up and windows open and close with out me doing any thing

    Hey since updating to OS X Mountain Lion 10.8.5
    my Mac has been playing up. I can't really control the mouse anymore
    it basically goes where it wants to go. Also my Mac started to open and close Windows on its one,
    switching back and forth between sides, as well as opening mission control and other things.
    It is impossible for me to use my Mac at the moment :
    Would be grateful for any tips on how to fix it !!!
    Thanx

    Try the troubleshooting help here > Portables and Magic Trackpad: Jumpy or erratic trackpad operation

  • IMessage beta loose all saved conversations when I open and close a window.

    iMessage beta looses all saved conversations when I open and close a window.
    Just reporting this bug... Could not find anyother place to do it.
    Jonathan

    I thought it was doing that also. But I found that if I start a new chat with someone I was messaging before, then the old messages re-appear in the messages window.

  • Reader opens and closes immediately by itself when try to open PDF from windows live mail or browser

    Hi,
    I'm having problems with acrobat xi since installing it on my windows 7 computer.
    Every time I try to open up a pdf file from windows live mail or a browser.. it opens and closes immediately.  The only way I can view it is if I save the file onto the computer, open up acrobat reader first then open up the file in there.
    How do I make it work properly again please?
    I've tried several things  so far like..
    -Using Windows Explorer navigate to C:\Program Files (x86)\Adobe\Reader 11.0\Reader, then double-click on Eula.exe and accept the license agreement
    -Disabling Protected Mode [Edit | Preferences | Security (Enhanced)].
    Please help me.  Thanks.

    How can I tell which one it is exactly?  I think it is Acrobat Reader.. 11.0.10...
    I can only open up a PDF if I save it to my computer and then open up the Acrobat program then open up a file using file > open.
    But if I try and view a pdf from an email attachment in Windows Live Mail.. or from a browser... it will open and close immediately.
    How do I fix this please?  thanks.

  • When I click on the pinned Firefox icon it only opens and closes one window rather than opening a new window.

    It used to be that every time I clicked on the pinned Firefox logo in the taskbar a new window would open. Now when I click the pinned logo it only opens and closes one window.

    hello, this seems to me like intended behaviour - all other open programs behave the same way, a click on the pinned icon minimizes them, another one brings them back to the foreground.
    you can open a new window by right-clicking on the firefox icon & selecting that option. the keyboard shortcut for it would be ctrl+n, or you can also [[Customize Firefox controls, buttons and toolbars|add a "open new window" button]] onto the firefox user interface.

  • Whenever I launch the Mail application on my iPod Touch, the window opens and closes immediately. What can I do?

    Whenever I try to launch the Mail application on my iPod touch, the window opens and closes immediately. I just restarted the device, but there's an icon on the screen of a circle.

    Try a hard reset and go from there.
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G + 120G OCZ Vertex 3 SSD Boot HD 

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • Any way to see ICONS in Open and Close Dialog boxes?

    Is there any way to see ICONS in Open and Close Dialog boxes, instead of just lists of items names?
    I know you can preview one at a time, but I'd love to see all my artwork as picture icons, just as you can in a finder window.
    Windows does this, but not OSX that I know of. Is there a third party app that enables you to see icon view in the Open and Close Dialogs?

    Thank you Steve Jobs. I guess that feature has been added in Leopard. Now there really is nothing that I'll miss from Windoze.

  • Open and Close Front Panel of SubVI

    Hi all,
    Running LabVIEW 2011 on Windows 7 x64.  I am trying to get a subVI front panel to open from my main FP with the press of a button and then close with a button press in the subVI.  Here is the piece from my main FP that calls the VI and opens the FP 
    Plots is defined in another loop and all of the loops are in a flat sequence.  I did it this way because I want it to start with the first press and not stop my main loop from running.  I have moved the item in the left loop around a lot so I'm not sure if I can run that in the same loop as the event or not.  Either way opening the VI seems to work fine.
    The problem shows up when trying to close the subVI for the SECOND time.  The code is here:
    As I said, the first time I open and close the VI everything works as I expect it should.  I am then able to open it again but now the "blank button" doesn't function and I can't close the window or even open the block diagram to probe anything.  I have been trying to figure this out for awhile, any insite would be greatly appreciated!
    Thanks
    Solved!
    Go to Solution.

    Its good that you found the bug.
    This code may serve as a way for you to compare notes.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Open and Close OnScreen Keyboard while focus gain on JTextField

    Hi
    I have a Jtextfield when ever I click on textfield I want to open OSK(On Screen Keyboard) of Windows 8 OS and windows 7.
    I tried in below mentioned way to open and close in focus listener focusGained() and focusLost() but it is not working. could some body do needful.
    Opening OSK:
    builder = new ProcessBuilder("cmd /c " + sysroot + " /System32/osk.exe");
    Closing Osk:
    Runtime.getRuntime().exec("taskkill /f /im osk.exe");

    You need to start() the ProcessBuilder and you need to split the command like this:
    builder  = new ProcessBuilder("cmd", "/c", sysroot + " /System32/osk.exe");
    builder.start();
    And naturally you should wrap the call in a new Thread or use an ExecutorService to avoid EDT problems.

  • Logging open and close of documents?

    I'd like to have a record of when I open and close documents, so that I can support my diary notes of jobs I've been working on. So I need to have the filename recorded. I can find an app' to log application usage; is there one for file usage ?
    regards, alan

    Hi, alan.
    This search of VersionTracker reveals two apps that track document time. Of the two, T3, looks exactly like what you want, but it is expensive. Check out the developer's site
    Active Timer may be more to your liking: it can track time at the application window level and is free.
    You can investigate other solutions by searching MacUpdate or Version Tracker. The user-submitted reviews accompanying the listings can be helpful in sorting the wheat from the chaff. Try searches for time track and look at the various options each provides.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

Maybe you are looking for

  • How to refresh the textedit object in module pool

    Hi All, I would appreciate if anybody can solve my problem. Problem is i have created one TEXTEDIT and now when user clicks on the cancel button and come back to the screen the data which was previously entered is still coming up. Please tell me how

  • Error when Exe a info Pack

    Hello, Experts. We have applied support packs.  its completed and i am testing the system.  i am getting the error when i exe a info pack and the error message is this. Error message<b> The Control Parameters for communication with the bw server are

  • Jquery - Detect Page / Item Change

    Hi Guys, I am aware of the skillbuilders save before exit plugin but I was wondering if there is a stripped down version, maybe some Jquery to identify if a Page has had any changes made. For example if an item on a page is accessed / changed in anyw

  • What brush was used to create this artwork?

    I am not familiar with using brushes in illustrator. Just wondered where to start! Underdog

  • Display T CODE IN PFCG

    dear guru, please let me know how to display tcode when we add Transactions Codes manually in PFCG MENU tab... it the tree its only showing the description of transaction not T-CODE.. please advise it will help me..