Javascript throws error in IE but works fine in Firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • user1980
    New Member
    • Dec 2009
    • 112

    Javascript throws error in IE but works fine in Firefox

    I have an asp page that call a java script function to open a new window. this works well in Firefox, but in IE, it does not work. When I check the error on page at the bottom of the page, it gives me the error as "Invalid argument." I did check the syntax but could not find anything wrong with it. Can somebody please guide me on this.

    Please find my code below

    Code:
    function popup(studentID)
    {
    //alert(studentID);
    	var answer = confirm  ("Are you sure you want to delete this student?");
    	var page;
    	page = "deletestudent.asp?id="+studentID;
    
    	if (answer)
    	{
    	window.open(page, "Delete Student","location=1,status=1,scrollbars=1,width=100,height=100");
    		location.reload();
    		return true;
    	}
    	else
    	{
    		location.reload();
    		return false;
    	}
    
    }
    thank you
  • user1980
    New Member
    • Dec 2009
    • 112

    #2
    Originally posted by user1980
    I have an asp page that call a java script function to open a new window. this works well in Firefox, but in IE, it does not work. When I check the error on page at the bottom of the page, it gives me the error as "Invalid argument." I did check the syntax but could not find anything wrong with it. Can somebody please guide me on this.

    Please find my code below

    Code:
    function popup(studentID)
    {
    //alert(studentID);
    	var answer = confirm  ("Are you sure you want to delete this student?");
    	var page;
    	page = "deletestudent.asp?id="+studentID;
    
    	if (answer)
    	{
    	window.open(page, "Delete Student","location=1,status=1,scrollbars=1,width=100,height=100");
    		location.reload();
    		return true;
    	}
    	else
    	{
    		location.reload();
    		return false;
    	}
    
    }
    thank you
    hi..

    I could make it work..window.op en has a page name, Delete Student. I did remove the space and it works fine now.

    Thanks

    Comment

    Working...