I am using codeigniter and in one of the views I have the following function triggered when the employee code does not exist in the database(using jquery ajax - works fine). the confirm popup displayes when the entered code is not valid but when the result of confrim is true, the following code does not fire the popup window!

function popup(){
        if(confirm("Employee_code not available! \nSave the code as new employee?")){
            //var new_emp_window = "<?php echo base_url().'index.php/it_inventory/new_employee'; ?>";
            widnow.open('www.google.com', 'width=500, height=500');
        }else{
            alert("ohh!");
            $('#employee_code').val('').focus();
        }
    }
有帮助吗?

解决方案 2

  1. First of all change www.google.com to http://www.google.com. As the browser handles URLs without protocol prefix as relative paths.

  2. Check that popup blocker is not active on your browser.

其他提示

it should be window not widnow, change:

widnow.open

to

window.open

try:

window.open("www.google.com", "_blank", "width=500,height=500");

See: window.open()

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top