Missing ")" in JS [closed]

1

In the browser console I get the following error when I hit the button. The function that accesses when giving click is responsible for not allowing a created window to be re-dimensioned. Can someone tell me what the syntax error is?

function createWindow(src, width, height){
    var win = window.open(src, "_new", "width="+width+,"height="+height);
    win.addEventListener("resize", function(){
        console.log("Resized");
		win.resizeTo(width, height);
    });
}
<button onclick="createWindow('about:blank', 450, 250)">Crear ventana</button>
    
asked by Eduardo 26.10.2017 в 18:05
source

1 answer

3

The SRC parameter of the function window.open() must be a string: 'about:blank'

link

I leave the solution in jsfiddle because here the snippets do not have permission to open windows

    
answered by 26.10.2017 / 18:12
source