tere naam
tere naam

Reputation: 7

Javascript Window.open on page load

I have used JavaScript on body onload event I used this code:

function timeMsg()
{
    var t=setTimeout("mywindow()",1000);
}

function mywindow()
{
    var win = window.open('http://202.125.144.34:83/FDB_prog.aspx', '_blank','width=1 height=1 left=2000 top=2000');
    return true;
}

and also on page load a pdf file is open inside my web page using this code

Private Sub ReadPdfFile()
    Dim path As String = "C:\Inetpub\wwwroot\db\Files\rwservlet_reptest&report=sap_dashboard.pdf"
    Dim client As Net.WebClient = New Net.WebClient
    Dim buffer() As Byte = client.DownloadData(path)
    If (Not (buffer) Is Nothing) Then
        Response.ContentType = "application/pdf"
        Response.AddHeader("content-length", buffer.Length.ToString)
        Response.BinaryWrite(buffer)
    End If
End Sub 

when the page load a pdf file open and also popup window,problem is that when i reresh the page which is callong pdf the popup window dnt open.I want to open every time when page is loaded each time

Upvotes: 0

Views: 1442

Answers (1)

dku.rajkumar
dku.rajkumar

Reputation: 18568

try something like

window.onload = timeMsg;

or

window.onload = function()
{
var t=setTimeout("mywindow()",1000); 
 // call other functions which you want to be called when window loads   
}

Upvotes: 1

Related Questions