1

Hi I'm working on a project there I found line like this :

window.open("url/example",false);

but I read on w3schools.com that window.open accepts four parameters:

http://www.w3schools.com/jsref/met_win_open.asp

they listed second parameter as name and it accepts following values:

name    Optional. Specifies the target attribute or the name of the window. 

The following values are supported:

        _blank - URL is loaded into a new window. This is default
        _parent - URL is loaded into the parent frame
        _self - URL replaces the current page
        _top - URL replaces any framesets that may be loaded
        name - The name of the window

I'm just wondering what false representing in my code thanks in advance... Sorry if not good question. JS newbie .

0

1 Answer 1

4

false will be typecast to a string, which will be "false".

Sign up to request clarification or add additional context in comments.

2 Comments

see this scenario. currently my site is working in fullscreen and when i bind this function with a image. when i'm passing false and click on image then it opens a new tab with given url. if i pass true then it open in same tab ?
Sounds like a browser bug (or possibly a window that is already called "true"). Avoid the problem entirely by giving new windows sensible names instead of passing in unexpected types of variable. Better yet, stick to one window, page triggered new windows are annoying.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.