×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    21

    Exclamation Close Widget with Window.close() not working

    I want to have the widget close when window.onload

    window.onload = launchwebpage;

    function launchwebpage()
    {

    ....
    widget.openURL(...)
    window.close() <-- have no effect to the widget itself

    }

    I am using N97 has anyone come across this problem?

    Thanks

    Stephen

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Close Widget with Window.close() not working

    Hi Stephen,

    some questions:
    * is the previous code line (the "widget.openURL(...)" call) correctly executed?
    * does the window.close() work if you remove all the previous JavaScript code (including the "widget.openURL(...)" call)?

    Pit

  3. #3
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    108

    Re: Close Widget with Window.close() not working

    Hi,
    I used this code and is woring fine.
    Try this.
    function openweb_closewidget(){

    widget.openURL("http://google.com");
    var WRT = window.open("", "_top");
    WRT.close();

    }
    remesh

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    9

    Re: Close Widget with Window.close() not working

    Same here on my N97. In both cases after I close the browser a blank page is shown which I have to close also.

    The blank page has softkeys left options-close and right key is close.

    Open applications show widget as open.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    16

    Re: Close Widget with Window.close() not working

    I have this same problem, window.close() does nothing. I have to use window.menu.showSoftkeys() which is cumbersome for user.

    Edit: I made new empty widget project with only one button for calling window.close. Nothing happens.
    Last edited by LyhjeHylje; 2009-09-02 at 12:43.

  6. #6
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    103

    Re: Close Widget with Window.close() not working

    hi

    var WRT = window.open("", "_top");

    working fine


    Tarun(TJ)

  7. #7
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Close Widget with Window.close() not working

    Hi,

    I've found a workaround that seems to work for cases where the standard 'window.close()' method does not, by using the following code:
    Code:
    widget.openURL("http://www.google.com");
    	
    setInterval('window.close()', 100);
    Hope it helps,
    Pit

    PS: if this issue (and its workaround) are confirmed from Nokia technical team, wouldn't it be nice to have a related Known Issue article on Forum Nokia Wiki?
    Last edited by jappit; 2009-09-04 at 10:00. Reason: KI article suggestion

Similar Threads

  1. Home screen widget screen sizes guidance on N97
    By quangtrung89 in forum Symbian
    Replies: 1
    Last Post: 2009-05-08, 22:18
  2. Widget extension
    By t.w in forum Symbian
    Replies: 2
    Last Post: 2009-04-30, 10:48
  3. Replies: 1
    Last Post: 2009-04-14, 21:52
  4. Replies: 1
    Last Post: 2009-03-04, 15:42
  5. No rule to male target
    By arayappan_it in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2008-02-28, 10:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •