Question

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();
        }
    }
Was it helpful?

Solution 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.

OTHER TIPS

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()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top