Current location: Hot Scripts Forums » General Web Coding » JavaScript » Newbie problem with OnClick newwindow and ASP


Newbie problem with OnClick newwindow and ASP

Reply
  #1 (permalink)  
Old 11-30-05, 04:59 AM
ianric ianric is offline
Newbie Coder
 
Join Date: Nov 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Question Newbie problem with OnClick newwindow and ASP

Hi

Not sure if this is a javascript or ASP problem. The code in the head of the ASP page is

<script language="javascript">
function newWindow(link)
{
link = window.open(link,'new', 'width=600, height=500, scrollbars=yes, resizable=no, top=35, left=300')
}
</script>

The code for the link is below and its all on one line. The RefNo variable comes from an SQL database.

Response.Write "<td width='41' align='center' height='32' valign='middle'><b><a href='RefNo/RefNo.asp?RefNo=" & RefNo & "' onClick='javascript:newWindow(RefNo/RefNo.asp); return false;'><img alt='More...' src='images/MAGNI-GLASS.gif' border='0' width='15' height='16'></a></b></td>"

The page is displaying and working OK, I get the link, image and the querystring is passed to the new window and the resulting info is correct. the only problem is that the new window doesn't popup. I think it maybe the double and single quotes in the wrong place or something easy but I can't see it.

The original line is below and that didn't work either.

<a href='RefNo/RefNo.asp?RefNo=" & RefNo & "' onClick='javascript:newWindow('RefNo/RefNo.asp?RefNo=" & RefNo & "','880451',''); return false;'>

The original line from the static table is below and this works fine

<a href="RefNo/ICR27265.htm" onClick="javascript:newWindow('RefNo/ICR27265.htm','880451',''); return false;">

Thanks

Ian
Reply With Quote
  #2 (permalink)  
Old 11-30-05, 05:32 AM
ianric ianric is offline
Newbie Coder
 
Join Date: Nov 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
***Solved***

Hi

'javascript:newWindow(RefNo/RefNo.asp); return false;'
'javascript:newWindow(this.href); return false;'

Thanks

Ian
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 10:59 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.