Jump to content
Xtreme .Net Talk

Problems encountered in calling the following javascript.


Recommended Posts

Posted

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:

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:

 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.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Posted

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.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Posted

Solution found. It is necessary to place the value null in for the name parameter.

 

Mike55.

A Client refers to the person who incurs the development cost.

A Customer refers to the person that pays to use the product.

------

My software never has bugs. It just develops random features. (Mosabama vbforums.com)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...