Click to See Complete Forum and Search --> : Javascript openBrWindow in asp.net


LovelyHelp
March 19th, 2006, 12:04 PM
I trying to have my hyperlink open on the new page using java script which I have my code in this way and it is place as default.aspx.vb

hyperlink.Text += "<li><a class='lesson' onClick='MM_openBrWindow('" + Title("link_url") + "','pic','width=420,height=520')'>" + Title("link_title") + "</a></li><br>"
I have my java script at the defualt.aspx
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
and this line of code doesnt work in asp.net...the hyperlink are not function.

If i have my line of code as below..It doing well. But I will like to have the new page when window open as above.
hyperlink.Text += "<li><a href='" + Title("link_url") + "' target='_blank' class='lesson'>" + Title("link_title") + "</a></li><br>"

Is any one can help?

HanneSThEGreaT
March 20th, 2006, 06:58 AM
A few things that bothers me:
<script language="JavaScript" type="text/JavaScript">

You don't need Language and type, here. You can either use
<Script Language = "JavaScript">
or
<Script Type = "text/JavaScript">
only!.
The latter <Script Type = "text/javascript"> is the preffered way these days, because the Language attribute of the Script tag is going to fall away.

Then
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
This, at the end of the day is, in my opinion, unecessary. The JavaScript Object Model has the open method built in for the window object, which contains the parameters URL, name, and features already.