Javascript open method

I have an Apex 2.0 application where I have a report with a column that contains an icon with an href tag that calls a javascript method. The function provided below is supposed to take in that variable and utilize the open method to "reload" the page. The expectation is that by reloading the page and passing in the item value via the URL definition that I would then be able to issue a doSubmit() call that would execute a DELETE process.
Unfortunately, what I am finding is that the open method is never actually called when a doSubmit method is to be subsequently executed. This is confirmed by the fact that the deletion never occurs and that the value of :P50_RECORD_ID is not set. However, if I remove the duSubmit() method from the code then the open method works perfectly and assigns the value of :P50_RECORD_ID to the value of id.
Any ideas on how I can get this process flow to work?
<script language="JavaScript" type="text/javascript">
function Delete(id)
var url;
url = 'f?p=&APP_ID.:50:&APP_SESSION.::::P50_RECORD_ID:' +
id;
open(url, "_self");
if (confirm("Delete this submitted recommendation?"))
doSubmit('Delete');
</script>
If anyone would like more clarification please let me know! Thanks in advance!
-Rudy Wilkinson

Hi Rudy,
A few questions:
1 - have you tried using document.URL = url; instead of open()
2 - Once the new url has been loaded, surely the remaining javascript doesn't run anyway?
3 - Are you trying to get the user to confirm deletion of a record and use the url to perform the deletion? If so, shouldn't the confirm() function be first?
4 - You say "DELETE" process, but are calling doSubmit('Delete') - should this be doSubmit('DELETE')?
Andy

Similar Messages

  • "Open method of Workbooks class failed" when opening Excel file via Internet Explorer

    (apologies, I posted this first to the general Office 2010 forum, but then realized this was probably a better spot to post)
    We have an Excel COM add-in installed on users' PCs.  This add-in responds to workbook open events by opening a particular XLA file (also deployed to the PC) to make certain features available.  This process works flawlessly when Excel files are
    opened locally - but when a user attempts to open an Excel file from an IE link, we get the following error: "Open method of Workbooks class failed".  This is happening on the line that is trying to open the XLA file.  This only happens
    when launching an Excel link from IE - works fine in Chrome or Firefox.
    I have found several posts on this topic, but no solutions:
    1. This post (https://social.msdn.microsoft.com/forums/office/en-US/73c96005-84af-4648-b103-32b677205be3/open-method-of-workbooks-class-failed)
    is the closest to our problem.  In this case, the "answer" was that the user may not have access to the 2nd workbook being opened.  But in our case, we're opening an XLA that is on the local machine, and I've confirmed that it is not
    corrupt and accessible (read & write, just in case!) to Everyone.
    2. This (very old) post (http://www.pcreview.co.uk/forums/open-method-workbooks-fails-excel-hosted-ie-t965608.html)
    seems similar, but is talking about opening Excel inside of IE.  This is not what we're doing - the link is supposed to (and does) open Excel outside of IE.  Interestingly, Excel.exe is being launched with the "-embedded" flag, even
    though it isn't running in the IE window.  When launching Excel by opening the file locally, Excel.exe is run with the "/dde" flag instead.  Clearly the "-embedded" mode is what is causing the problem.  I could change the
    links on the web page to use some JavaScript to open Excel differently... unfortunately, the links are actually generated by SharePoint (the Excel files are in a SP repository), so this is not really an option.
    3. This Microsoft KB article (http://support.microsoft.com/kb/268016) talks about problems opening an XLA directly from IE... but this is the case of a link pointing
    directly to an XLA file, not opening a regular workbook that in turn opens an XLA, as is my case.  In fact, this article specifically points out in the "More Information" section that "End users do not normally open XLAs; instead they open
    an XLS that (if needed) loads one or more XLAs during startup." ==> precisely what I'm trying to do that is giving me the error!
    I've replicated the situation with a very simple COM add-in (created in VS2010 using VB.Net) and a very simple XLA file (does nothing, just pops up a message in auto_open).  For anyone wanting to try it out, here is the exact test case:
    1. In Excel, create a simple XLA file containing only the following code, and save it in C:\TEMP\dummy.xla:
    Sub Auto_Open()
    MsgBox "Auto Open fired"
    End Sub
    2. In Visual Studio, create a new Excel 2010 Add-In.  I created mine via Visual Basic, but I doubt the choice of language matters.  Place the following code in ThisAddin.vb:
    Public Class ThisAddIn
    Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
    AddHandler Me.Application.WorkbookOpen, AddressOf Application_WorkbookOpen
    End Sub
    Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
    End Sub
    Sub Application_WorkbookOpen(ByVal workbook As Excel.Workbook)
    On Error GoTo ErrHandler
    If (Not workbook.Name.Contains("dummy.xla")) Then
    MsgBox("Workbook open")
    Application.Workbooks.Open("C:\temp\dummy.xla")
    Application.Workbooks("dummy.xla").RunAutoMacros(Excel.XlRunAutoMacro.xlAutoOpen)
    End If
    Exit Sub
    ErrHandler:
    MsgBox(Err.Description)
    End Sub
    End Class
    3. Build & publish this add-in and install it on the same machine as the XLA created in step 1.
    4. Create and save an empty Excel workbook (I called mine WayneTest1.xlsx) - save it locally (on your desktop), and put a copy somewhere on your web server (I put mine directly in c:\inetpub).
    5. Create an HTML file with a link to that workbook, saving it to the same web server location - here is mine:
    <html>
    <body>
    <a href="WayneTest1.xlsx">Link to Excel file</a>
    </body>
    </html>
    6. Double click the workbook on your desktop (from step 4) - opens fine, I get the "workbook open" message, following by the "Auto Open fired" message.
    7. In Internet Explorer, navigate to the HTML file specified in step 5 and click on the link - when prompted, select "Open" - I get the "workbook open" message, following by the error message "Open method of Workbooks class failed".
    Here are a few things I've ruled out / tried so far:
    - Unchecked all the "Protected View" settings in Excel, made no difference
    - Unchecked all the "File block settings" in Excel, made no difference
    - Made sure dummy.xla was open for read & write to Everyone
    - Made sure the web page was in Trusted sites and set the security level to Low for those sites in IE
    - Tried making the local desktop file (step 6) readonly, made no difference (i.e. launching it locally still worked fine)
    - Tried using Excel 2013 - made no difference
    Any ideas / suggestions?

    Hello Wayne,
    Apologies for the delay.
    I went through your post and tried to reproduce the issue. I was able to reproduce it. Based
    on its complexity and as it requires more in-depth analysis, your question falls into the paid support category which requires a more in-depth level of support.
    Please visit the below link to see the various paid support options that are
    available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone
    Thanks,
    Anush

  • Is there any Java API equivalent to Javascript eval() method?

    Is there any Java API equivalent to Javascript eval() method?
    Regards
    Rakesh

    No there isn't however you can use Jython (or another scripting language of your choice) to reproduce this functionality.

  • Javascript menu does not open, gets 'Javascript Open' box.

    A client with IPAD iOS 5.1.1 does not open a menu on my website.  But 2 similar Ipads do open the menu fine.  The client has Javascript 'on' in Safari.  When he taps a little longer, he gets a box that says 'Javascript Open' but nothing further happens.  I am not a developer, just trying to get the client into his data.  Any ideas?  Is there another setting I should have on?

    some things he might try:
    In Settings, make sure private browsing is not turned on. Without knowing the specific script and mechanism, I wouldn't think this is the cause, but worth checking.
    Clear history and clear cookies and data
    Double click the home bottom and close Safar from the apps tray.
    Reset the iPad: Simultaneously hold down the Home and On buttons until the iPad shuts down, then restart it.

  • Visio Conversion Failed on open method

    Hi all, we have developped a C# remoting application (.NET 1.1) that use Acrobat Pro v7.0 on server side (Windows 2000 SP4)
    This server application have to convert Visio files to PDF files.
    For this we use Acrobat Interop SDK as follow :
    Acrobat.CAcroApp app = new AcroAppClass() ;
    Acrobat.CAcroPDDoc PDDoc = new AcroPDDocClass() ;
    Acrobat.CAcroAVDoc AvDoc = new AcroAVDocClass() ;
    DirectoryInfo directory = new DirectoryInfo(myDirSource) ;
    if(directory.Exists)
    FileInfo[] filesInfo = directory.GetFiles(FICHIER_VSD) ;
    foreach(FileInfo myfile in filesInfo)
    // OPEN may failed
    if(AvDoc.Open(myfile .FullName, "Export PDF") == true)
    AvDoc = (Acrobat.CAcroAVDoc)app.GetActiveDoc() ;
    if(AvDoc.IsValid() == true)
    PDDoc = (Acrobat.CAcroPDDoc)AvDoc.GetPDDoc() ;
    string fileNameDest = myDirDestination+ "\\" +
    myfile.Name.ToLower().Replace(EXTENSION_VSD,EXTENSION_PDF) ;
    PDDoc.Save((short)PDSaveFlags.PDSaveFull, fileNameDest);
    PDDoc.Close() ;
    PDDoc = null;
    AvDoc.Close(0) ;
    }// end foreach(FileInfo myfile in filesInfo)
    app.Exit() ;
    AvDoc = null;
    app = null;
    The application works fine most of time.
    In some case the Visio conversion failed in open method, so no pdf is generated and Visio and Acrobat popup dialog appears.
    The problem is not due to Visio Data, because the same file can be well converted or failed!
    More when this problem occurs in application it occurs too using directly conversion from Visio or Acrobat.
    Some time we have to repair Visio and Acrobat Pro...
    We suspect that there is something wrong on the platform (context pb, install pb...).
    So the questions are:
    - is there a documentation about what Acrobat (PDF Maker) does during conversion.
    - is there any way to understand why "open" method failed (just return true or false).
    - is there any log file that can give informations about failed conversion.
    - is there some cache mechanism during conversion that can cause the pb during open file.
    Thanks for reply.
    NicolaS.

    Yes NicholaS this is a technical forum and not a pre-sales forum.
    However, Leonard is an Adobe employee and is simply protecting the interests of his company from people publicly commenting on their illegal and unlicensed use of his products (on that companies forums, nonetheless) as any good employee should.
    You agreed to the EULA when you installed the application. If you chose not to read what you were agreeing to and end up breaching that agreement it is not Leonard or Adobe's fault, it is solely your own.

  • Desktop.open() method doesn't work,

    Hi,
    I'm developing file explorer with JDK6.
    But when I try to open file with native asscociation programs with java.awt.Desktop class, I found that's not work at all.
    there is no response, exception and error. it just 'silent.'
    I checked each line of code. File is exist, Desktop support Open action.
    OS association with file is correct. I couldn't find any problem.
    so I tested tutorial code 'DesktopDemo'. it worked well Browse() but not Open(). open() method isn't work. (It also silent)
    How can I open file with native association?

    Please don't post to threads which are long dead, and don't hijack another poster's thread. When you have a question, start your own thread. Feel free to post a link to a related thread.
    Discussions may be kept on the forum. This is not a place to advertise your blog.
    I'm locking this thread now.
    db
    StijnDeWitt wrote:
    This seems to be a long-running problem related to Desktop.open in combination with Windows and some Account/Profile settings on Windows which are as of yet undetermined.
    Unfortunately the moderators of this forum have the tendency to close/lock old topics so we cannot add new information to a long running problem anymore after a while. They forgot to close this one so luckily I can still add some info here.
    I would like to invite anyone wanting to read details on and discuss this issue to do so on my blog. The comments on that post will never be closed or locked.
    java.awt.Desktop open() fails silently without exception
    (blog link removed)
    >
    You may also want to have a look at these related (but unfortunately locked) forum posts:
    [Desktop.open fails without exception, nothing happens (Locked)|http://forums.sun.com/thread.jspa?threadID=5338022]
    [Desktop.getInstance().open(file) does nothing (nothing happens) (Locked)|http://forums.sun.com/thread.jspa?threadID=5413798]

  • IE 11, built-in Administrator account, window.open method, JA KB 2909974 exists.. not EN-US ?

    As per title....
    The JA KB (when translated) states,
    If you use the built-in Administrator in Internet Explorer 11, when you open a new window named, such as window.open method, window name is not recognized.
    Therefore, the following phenomenon will occur.
    If you specify in the window.open method of the window named, rather than a window that is already open, URL is displayed in a new tab or new window
    If you specify in the target attribute of the link or form window named, not the window that is already open, URL is displayed in a new tab or new window
    What's Microsoft's comments on tracking to a resolution of this ?

    luca wrote:
    Hi krazyshane,
    try to add this directive in Section "Device":
    Option "DRI" "true"
    This got it!  Thanks! 
    Shane

  • DB- get_byteswapped: method not permitted before handle's open method

    Hello.
    I am trying to create a C++ class that can hold a Berkeley DB object as one of its instance variables. When I call the open method, I get the error "DB->get_byteswapped: method not permitted before handle's open method".
    Question: How can this error appear when I am calling the open method?
    The code is like this:
    ---DB.h
    #include <db_cxx.h>
    class myClass {
    private:
    Db* myDb; // A pointer to my Db object
    ---End of DB.h
    -- DB.cpp
    #include <db_cxx.h>
    myClass::myClass(){
    myDb = new myDb(NULL,0); // Create and call my object's constructor
    myDb->open(NULL, "myFile.db", NULL, DB_HASH, flags, 0); // Open the db.
    --- End of DB.cpp
    Thanks for any help you might provide,
    Erich

    Hello,
    This sounds like a build problem. What version of Berkeley DB are you wanting to use? Multiple versions of Berkeley DB can be found on a system. Please check to make sure that you are not picking up a header file from a different version, or linking with with a different version. Verify your paths are not picking up multiple versions of include files, libraries. Compiling, linking, running with a combination of versions could lead to such unusual runtime results.
    Thanks,
    Sandra

  • "DB- put: method not permitted before handle's open method"

    Hi,
    A deadlock caused during a read/update/write circle. After aborting and
    recreating the transaction, I get the error message:
    DB->put: method not permitted before handle's open method
    To produce the error, set a breakpoint to "Set the breakpoint here", start the
    programm, wait until the debuger is there, start the same program a second time,
    now the deadlock occurs.
    Break the deadlock of the first process: "db_deadlock -ao"
    The first process (broken by "db_deadlock" runs into the transaction recovery
    section and creates the error-message.
    System: MinGW
    The below code is simplified:
    #include <malloc.h>
    #include <string.h>
    #include <sys/stat.h>
    #include <db.h>
    #define FLAG_ENV_OPEN DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN | DB_REGISTER | DB_RECOVER
    int main( int argc, char *argv[] )
    const char *environment_directory = "C:\\Temp";
    const char *database_file = "C:\\Temp\\test.db";
    const char *key_data = "key";
    const char *data_data = "there is something";
    DBT key, data;
    // If database does not exists, create a database with one element
    struct stat buffer;
    int status = stat( database_file, &buffer );
    if( status != 0 )
    DB *database_handle = NULL;
    int status = db_create( &database_handle, NULL, 0 );
    status = database_handle->set_flags( database_handle, DB_RECNUM );
    status = database_handle->open( database_handle, NULL, database_file, NULL, DB_BTREE, DB_CREATE, 0644 );
    memset( &key, 0, sizeof(DBT) );
    key.data = (void*)key_data;
    key.size = strlen(key_data);
    key.flags = DB_DBT_USERMEM;
    memset( &data, 0, sizeof(DBT) );
    data.data = (void*)data_data;
    data.size = strlen(data_data);
    data.flags = DB_DBT_USERMEM;
    status = database_handle->put( database_handle, NULL, &key, &data, 0 );
    database_handle->close( database_handle, 0 );
    // Create environment
    DB_ENV *environment = NULL;
    status = db_env_create( &environment, 0 );
    status = environment->set_cachesize( environment, 0, 4 * 1024 * 1024, 0 );
    status = environment->open( environment, environment_directory, FLAG_ENV_OPEN, 0644 );
    // Create transaction
    DB_TXN *transaction = NULL;
    status = environment->txn_begin( environment, NULL, &transaction, 0 );
    // Open the created database
    DB *database_handle = NULL;
    status = db_create( &database_handle, environment, 0 );
    status = database_handle->set_flags( database_handle, DB_RECNUM );
    status = database_handle->open( database_handle, transaction, database_file, NULL, DB_BTREE, DB_CREATE, 0644 );
    // Create a read lock
    memset( &key, 0, sizeof(DBT) );
    key.data = (void*)key_data;
    key.size = strlen(key_data);
    key.flags = DB_DBT_USERMEM;
    memset( &data, 0, sizeof(DBT) );
    data.data = NULL;
    data.flags = 0;
    status = database_handle->get( database_handle, transaction, &key, &data, 0 );
    // Create a write lock
    memset( &key, 0, sizeof(DBT) );
    key.data = (void*)key_data;
    key.size = strlen(key_data);
    key.flags = DB_DBT_USERMEM;
    memset( &data, 0, sizeof(DBT) );
    data.data = (void*)data_data;
    data.size = strlen(data_data);
    data.flags = DB_DBT_USERMEM;
    // Set the breakpoint here:
    status = database_handle->put( database_handle, transaction, &key, &data, 0 );
    // Should be deadlock
    if( status == DB_LOCK_DEADLOCK )
    status = transaction->abort( transaction );
    status = environment->txn_begin( environment, NULL, &transaction, 0 );
    // Here is the problem
    status = database_handle->put( database_handle, transaction, &key, &data, 0 );
    // Close database
    database_handle->close( database_handle, 0 );
    // Close environment
    environment->close( environment, 0 );
    return 0;
    }

    Hi,
    The issue in your test case is the use of a transaction handle in the DB->open call, followed by an abort of that transaction. This aborts the DB->open operation, which is not what you intend.
    It is almost always simplest to pass NULL for the transaction handle to the DB->open call and add the DB_AUTO_COMMIT flag instead. Then if the open call succeeds, you have a database handle that is valid regardless of subsequent transaction aborts.
    Regards,
    Michael Cahill, Oracle.

  • AVDoc Open method & enhanced security/protected view

      I have recently inherited some code that merges two PDFs together using OLE automation.
    I've found that the code works with Acrobat X if Enhanced Security is disabled but it fails to open a PDF from a file if Enhanced Security is enabled (Protected View is set to All Files).
    I've traced the problem down to the Open method of the AVDoc class. Open always returns 0 even if the file exists.
    Is this the expected behaviour if Protected View is enabled? Are there any work-arounds?
    TIA
    Julie

    Thanks Lrosenth.
    I've seen that the equivalent can be done in Acrobat using Privileged Locations.  If I go to the Preferences manually and add my folder it works as expected.  However, if I use the Adobe Customization Wizard to include the trusted folder as part of the installation, it does not work - the preferences in the client do not show the trusted folder although the HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Adobe\Adobe Acrobat\10.0\FeatureLockDown\cTrustedSites registry key appears to be set correctly.
    Do you know if there are any issues with setting Privileged Locations using the Adobe Customization Wizard (version X)?  I came across the following technote which says setting privileged locations is fixed in version X.
    http://helpx.adobe.com/acrobat/kb/privileged-locations-customization-wizard-9.html
    Thanks
    Julie

  • Why doesn't the replace option of JavaScript's window.open method work with FireFox 3 or 4?

    The photo html files on the Fanac Fan History project's website are now setup to be displayed properly when JavaScript is disabled and reformatted by a php script when JavaScript is enabled. The reformatting adds some features and positions each photo's caption and credits based on the width of the photo and the browser's page width. This worked well except that when a photo page was accessed the browser's back button wouldn't work properly. This was because I had failed to include the replace option in my windows.open statement. The statement now reads fileWindow = window.open(fileURL, "_self", "", true); and this has cured the problem with IE and the other browsers but it still doesn't work with FireFox.
    PS: You need to add "Always" to "This happened".

    We're sorry to hear that your Firefox seems to be crashing when you open it. Please perform the following steps to give us a crash report ID that helps us find out more about the cause of the crash.
    #Press the following shortcut to get a Run window: [Windows] + [R]. This should bring up a window that contains a text field.
    #In that text field, enter %APPDATA% and press Enter. An explorer window should open.
    #From that explorer window, double-click on the ''Mozilla'' folder, then double-click on ''Firefox'' and then on ''Crash reports''. Double-click on ''submitted''.
    #Now, you should see a list of files that contain reports. Go to ''View'' > ''Arrange Icons by'' > ''Modified'' to get the most recent files at the top of the window.
    #Open the most recent 5 files with a text editor and copy the IDs.
    #Paste each ID with '''bp-''' into the reply window on the forums.
    Thanks in advance!
    You can find more information and troubleshooting steps in the [[Firefox crashes]] article.

  • Tif files not opening via Acrobat Javascript openDoc() method

    Hi,
    I am trying to open a .tif file via Acrobat Javascript using the following code snippet which I have in config.js file in Acrobat Javascripts folder:
    trustedOpenDoc = app.trustedFunction( function (File)
    app.beginPriv();
      var doc = app.openDoc({
          cPath: File,
          bUseConv: true
    app.endPriv();
    return doc;
    Problem is that openDoc opens up all other images but it has problem with multi page tif files, I mean it does not open some tif files. I have directly tried to open files in Acrobat professional 8/9 from File --> Open but got same result.
    The same happens also with some heavy (above 1 MB) .bmp files but with .bmp files this behaviour is not so frequent, on the other hand .tif files always give the same result.
    Any PDF Gladiator who can save my project deadline!
    Look please; I have this problem for the last 12 days and miserably my project is getting late becoz of this.
    Thanks in advance for the resolution/suggestion.

    You guys are not getting my point.
    I am using Adobe Acrobat Professional 8/9 for creating a PDF that picks up text files and image (Jpg, bmp, tif) files from a network shared folder and inserts them into an empty Template PDF file by making use of Acrobat events through Javascript.
    This all works fine as long I dont include any Tif file and PDF is created successfully.
    Now all other file types including text files, jpgs, gif are opening up but problem is with .tif files.
    You can check this by directly opening image files in Adobe Acrobat Profesional 8/9 from File --> Open menu option.
    Other images will open up but most Tif files won't open in it. Such tif files also not open in "Winodws Picture and Fax Viewer" software but will open in softwares like "Imaging Professional" , "IrfanView" etc, which I think use some special codec for it.
    If you know of any Acrobat plugin that can be incorporated in Acrobat professional and convert these tif files to PDF on the fly, would be of great help or have some any other suggestion you feel is right.
    Thanks

  • Javascript open() function returns undefined

    The javascript function open() specs like "fullscreen", "width", "height", seem not to work under Safari while they do under Firefox, Opera and even Explorer. So, I open a popup with : Win=open("<url>","","") and then , I use Win.resizeTo(<width>,<height>) where <width> and <height> was evaluated previously . But I obtain the message : "TypeError : 'undefined' is not an object (evaluating Win.resizeTo)".
    I found several problems with Safari (performance different from other browsers), and up to now, I managed to get round the problem. But in this case, I go blank !!!
    Please, can you help me to produce a code visible by Safarists ;o)

    Beaver13 wrote:
    Thank you "etresoft". In fact, I wrote the inappropriate term function, but as I detailed above, I used correctly resizeTo as a method of "what should be a window object". Syntax of the evaluation of this object by open is also correct since the root object window is implicit. Anyway, I tried adding window or this and I obtained the same behavior.
    In theory that is true, but it isn't working for you. While I'm quite fond of Javascript, it is a very flexible language and you could have installed any number of 3rd party additions that do all kinds of crazy things with it.
    Finally, could you say me how you would  open a popup with given dimensions ?
    I normally don't use pop-ups but I have one special case where a page is displayed inside of Google Earth. Google Earth isn't a real web browser, but looks like one, so it needs lots of hacks to get some functionality. When the user clicks an image link, it uses this function to pop-up a new window that redirects itself to the appropriate image URL, successfully downloading the requested image instead of the nasty error message the user would have seen otherwise - and no download. I will add a few extra comments to explain what is going on...
    // Pass in the id of the item to download.
    function embeddedDownloadItem(id)
         // Center the pop-up in a platform-neutral way.
        var top =
            window.screenTop
                ? window.screenTop
                : window.screenY;
        var left =
            window.screenLeft
                ? window.screenLeft
                : window.screenX;
        top += $(window).height();
        left += $(window).width();
        // Move it over a bit.
        left -= 200;
        // Use the id to construct a selector to
        // find and extract the URL.
        var url = $('#url-' + id).attr('value');
        // Download the file via new window.
        downloadWindow =
            window.open(
                url,
                "Download",
                'top=' + top + ', left=' + left
                    + ',width=200,height=100');
        // Close the new window in 5 seconds.
        setTimeout("downloadWindow.close();", 5000);
        // Hide it until that happens.
        window.focus();
    As you can see, I am using jQuery which does some of that crazy stuff I mentioned earlier. However, that is not something you really want to live without. This is a special case that just pops up a window, redirects to download an image, and then goes away. I actually recommend not using pop-ups at all because they are too easy to block. In this case, it is running out of Google Earth with doesn't have a pop-up blocker, so I lucked out.
    I don't know why your code isn't working. Have you tried the demos at w3schools? They are always very handy.
    I agree with you, Safari has the best debugging features, but, I'm a little more circumspect about "the most standard compliant", but maybe I'm wrong.
    That is just what I have found. I am not really a web developer, but I have been roped into it. Because I don't really enjoy it, I don't have the same obsession towards perfection that I would elsewhere. If I can get it working in the major browsers, that's good enough for me.
    I always build in Safari first. The latest Safari has a few more debugging bells and whistles but is actually a bit harder to use in this aspect than the previous version. I build a "clean-room" version of the site in Safari with no hacks of any kind. Everything works as it should in an "ideal" browser, which just happens to be Safari. The console window and "window.console.log()" are your friends. "Inspect element" is very powerful.
    I don't bother with Chrome because it is so similar to Safari. I have never seen a significant difference between the two.
    Next up is IE7. Parallels to the rescue. Thankfully, I don't have to support IE6 anymore. IE has some very nice, version-specific hacks that allow you retain some of your sanity. I also use Zend which automatically generates these constructs. I can do something like:
            $this->view->headLink()->appendStylesheet(
                $this->view->baseUrl() . '/css/ie7.css', 'all', 'IE 7');
            $this->view->headLink()->appendStylesheet(
                $this->view->baseUrl() . '/css/ie8.css', 'all', 'IE 8');
    which will generate:
    <!--[if IE 7]> <link href="/css/ie7.css" media="all" rel="stylesheet" type="text/css" /><![endif]-->
    <!--[if IE 8]> <link href="/css/ie8.css" media="all" rel="stylesheet" type="text/css" /><![endif]-->
    Zend supports the same thing with Javascript, with a little bit more mess:
            $this->view->headScript()->appendFile(
                $this->view->baseUrl() . '/js_include/warning.js',
                'text/javascript',
                array('conditional' => 'IE 6'));
            $this->view->headScript()->appendScript(
                sprintf(
                    'window.onload=function(){e("%s")}',
                    $this->view->baseUrl() . '/images'),
                'text/javascript',
                array('conditional' => 'IE 6'));
    generates:
    <!--[if IE 6]> <script type="text/javascript" src="/js_include/warning.js"></script><![endif]-->
    <!--[if IE 6]> <script type="text/javascript">
        //<![CDATA[
    window.onload=function(){e("/images")}    //]]>
    </script><![endif]-->
    In this example, I just pop-up a warning saying IE6 isn't supported at all.
    You can do most of the IE7 and IE8 support with the above CSS hacks. If you need to change the structure to support IE, then once it works in IE you have to go back and re-test in Safari.
    I have found that IE9 is much more standards-compliant and needs very little help.
    Firefox is actually one of the flakier browsers these days - even more so than IE9. I actually have to add a special section of Firefox hacks at the end of my CSS like this:
    /* Firefox hacks */
    @-moz-document url-prefix()
        #kml_loading,
        #kmz_loading,
        #shapefile_loading
            top: -1px;
    Unfortunately, Firefox wasn't known to be a troublemaker like IE so the hacks are more ugly than in IE.

  • 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

  • Programmatically Open a Remote Front Panel with Panel Open Method

    Hi,
    I am trying to open the front panel of the VI on my cRIO-9024 through a remote computer. Currently, I am able to run the VI with no problems with the RUN VI method; however, when I try to open the front panel, I receive "Error 1043 - This property or method is not supported in this version of LabVIEW" or the Front Panel is simply not visible. My cRIO is configured to allow TCP/IP protocol, The VI is visible, and I have made my project into a source distribution on my cRIO.
    Any help or suggestions regarding this problem would be great. I am very new to LabVIEW.
    I have attached a screenshot of my block diagram and project.
    Thanks,
    Jake 
    Attachments:
    Block_Diagram.PNG ‏12 KB

    Project Img
    Attachments:
    MyProject.png ‏15 KB
    MyProject.png ‏15 KB

Maybe you are looking for