Problems encountered in calling the following javascript.

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Hi all

I am trying to call the following piece of javascript, it should simply open a new window and navigate to a particular page. Here is the javascript:
Code:
function newWindow(){
  var doc = document.forms[0];
  window.open("http://localhost/testApp/LegalAgreement.aspx", "width=550, height=550, resizable=0, menubar=no, scrollbar=no, status=yes, left=0, top=0")
}

Here is the code that I use to call the javascript in the page_load event:
Code:
  lBtnAgreement.Attributes.Add("onClick", "return newWindow();")

The code is not returning any errors, anyone suggest a solution. I have confirmed that other java script works on the machine, either in the codefile or in the html file.

Mike55.
 
Ok, I have found that the javascript code will work if I remove the width, height, etc. information and the ";" at the end. However if any of them are present, then the code refuses to work.

Mike55.
 
Back
Top