dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: [RESOLVED] window.open_parentwindow shows error in mozilla browser

  1. #1
    Join Date
    Jun 2017
    Posts
    4

    resolved [RESOLVED] window.open_parentwindow shows error in mozilla browser

    I am learning javascript. I am facing this error while running the below piece of code.

    <!DOCTYPE html>
    <html>
    <body>

    <a href='javascript:window.open("https://www.w3schools.com");'> W3Schools</a>

    </body>
    </html>

    After clicking the link("W3Schools")The child window is opening without any issue, but the parent window shows [object Window] error.

    This error is showing only in Mozilla Firefox but not in Chrome.

    Can anyone help me how to solve the error "[object Window]" in the parent window (in mozilla browser)?

    Regards,
    Priya Simon

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,231
    https://developer.mozilla.org/en-US/...PI/Window/open

    and please use the forum BBCode tags for wrapping any HTML, PHP or CODE tags around any code you supply.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  3. #3
    Join Date
    Jun 2017
    Posts
    4
    Thanks for the reply. I checked the sample, but my requirement is by clicking the link or a button icon, new window should get open.
    Sample: <a href='javascript:window.open("https://www.w3schools.com");'> W3Schools</a>


    Quote Originally Posted by \\.\ View Post
    https://developer.mozilla.org/en-US/...PI/Window/open

    and please use the forum BBCode tags for wrapping any HTML, PHP or CODE tags around any code you supply.

  4. #4
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,231
    Well... if its not opening, turn your popup blocker off...

    This is one big problem you will have with pushing popup windows, generally as a rule, you would avoid doing this for the very reasons that people have pop up blocking software and that goes back in history because popups and popunders were the scourge of the internet and still are today, people do not like them.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  5. #5
    Join Date
    Jun 2017
    Posts
    4
    New window is getting opened without any issue.

    After clicking the link("W3Schools")The child window is opening without any issue, but the parent window shows [object Window] error.

    This error is showing only in Mozilla Firefox but not in Chrome.

    <!DOCTYPE html>
    <html>
    <body>

    <a href='javascript:window.open("https://www.w3schools.com");'> W3Schools</a>

    </body>
    </html>


    Quote Originally Posted by \\.\ View Post
    Well... if its not opening, turn your popup blocker off...

    This is one big problem you will have with pushing popup windows, generally as a rule, you would avoid doing this for the very reasons that people have pop up blocking software and that goes back in history because popups and popunders were the scourge of the internet and still are today, people do not like them.

  6. #6
    Join Date
    Jun 2017
    Posts
    4
    Have found the solution. This is easy and it will work.

    <!DOCTYPE html>
    <html>
    <body>

    <a href='javascript:var x = window.open("https://www.w3schools.com")'> W3Schools</a>

    </body>
    </html>

    Thanks for all the help.

  7. #7
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,231
    When posting any code, please use the forum BBCode tags to wrap around your code. This has been pointed out further up the thread. Details are in my signature.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles