www.webdeveloper.com
Results 1 to 5 of 5

Thread: ASP and java Popup problem

  1. #1
    Join Date
    Sep 2005
    Posts
    13

    ASP and java Popup problem

    I have this code which works fine but it opens 2 windows with the same content but i only want on new windows full screen to open. why is it opening windows. can someone help. code lists content of diretory and sets up the URL like so they can be clicked and opens them in new fullscreen window. Really hope someone can help me

    <%
    Set fs = Server.CreateObject("Scripting.FileSystemObject" )
    Set fldr = fs.GetFolder( "c:\inetpub\wwwroot\EMEA\history" )
    For Each File in fldr.files
    %>
    <A href="http://198.90.24.32/EMEA-NMS/netcool-history/2007-history/<%=File.Name%>" target="_blank" onMouseOver="window.status='To Close Fullscreen press Alt+F4.';return true" onclick="window.open(this.href,'netcool','fullscreen=yes')" ><%=File.Name%></a><br>
    <%
    Next
    %>

  2. #2
    Join Date
    Aug 2005
    Location
    USA
    Posts
    116
    I think the reason that is happening is because you have a <a href> tag and also a onclick event that opens a new window.

    You might try just doing something like this:

    Code:
    <A href="#" onMouseOver="window.status='To Close Fullscreen press Alt+F4.';return true" onclick="window.open('http://198.90.24.32/EMEA-NMS/netcool-history/2007-history/<%=File.Name%>','netcool','fullscreen=yes')" ><%=File.Name%></a>

  3. #3
    Join Date
    Mar 2006
    Posts
    591
    Should work just fine.

    BTW it's javascript not java

  4. #4
    Join Date
    Nov 2005
    Location
    chennai, tamil nadu, india
    Posts
    77

    target=_blank is the problem

    in your code remove the target=_blank
    this is the one which is opening a window when the link is clicked
    and the other window is the one which is opened by onclick.

    try this...

    <A href="http://198.90.24.32/EMEA-NMS/netcool-history/2007-history/<%=File.Name%>" onMouseOver="window.status='To Close Fullscreen press Alt+F4.';return true" onclick="window.open(this.href,'netcool','fullscreen=yes')" ><%=File.Name%></a><br>

  5. #5
    Join Date
    Nov 2005
    Location
    chennai, tamil nadu, india
    Posts
    77

    for the onclick event return false

    use the above soultion or go for the following

    onclick="some process; return false;"

    in an hyperlink the onclick is the first one to be executed other than opening
    the link given in href=""... so after the some process is done we are disabling that event so the link in href will not be executed...

    try this...

    <A href="http://198.90.24.32/EMEA-NMS/netcool-history/2007-history/<%=File.Name%>" target="_blank" onMouseOver="window.status='To Close Fullscreen press Alt+F4.';return true" onclick="window.open(this.href,'netcool','fullscreen=yes'); return false;" ><%=File.Name%></a><br>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles