What event can be used to call a JavaScript function when the page loads AND
when it receives a response from the web server?
Thanks,
--
Mike
Mike McIntyre [MVP] http://www.getdotnetcode.com 5 1800
The body's onload event is raised when the page has been fully loaded.
I'm not sure what you mean about "when it receives a response from the web
server".
--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider http://SteveOrr.net
"Mike McIntyre" <mi****@getdotnetcode.comwrote in message
news:eV**************@TK2MSFTNGP02.phx.gbl...
What event can be used to call a JavaScript function when the page loads
AND when it receives a response from the web server?
Thanks,
--
Mike
Mike McIntyre [MVP] http://www.getdotnetcode.com
On Aug 18, 4:20 pm, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<St...@Orr.netwrote:
The body's onload event is raised when the page has been fully loaded.
I'm not sure what you mean about "when it receives a response from the web
server".
--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net
"Mike McIntyre" <mik...@getdotnetcode.comwrote in message
news:eV**************@TK2MSFTNGP02.phx.gbl...
What event can be used to call a JavaScript function when the page loads
AND when it receives a response from the web server?
Thanks,
--
Mike
Mike McIntyre [MVP] http://www.getdotnetcode.com- Hide quoted text -
- Show quoted text -
In the Page_Load method use:
string strScript = @"<script language=""javascript"">
window.alert(""put your script here""); </script>";
Page.ClientScript.RegisterStartupScript(typeof(Pag e), "ScriptName",
strScript);
That should do it.
Steve
"Steve Kershaw" <st***********@yahoo.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
string strScript = @"<script language=""javascript"">
That usage is deprecated because it's not XHTML-compliant - instead, use:
string strScript = "<script type=\"text/javascript\">
Or, even better, use the overloaded method of RegisterStartupScript which
adds in the script tags automatically: http://msdn2.microsoft.com/en-us/lib...8y(VS.80).aspx
--
Mark Rae
ASP.NET MVP http://www.markrae.net
This seems to fire only when the page is first loaded into the browser - not
each time the page gets a response from the server.
--
Mike
Mike McIntyre [MVP] http://www.getdotnetcode.com
"Steve Kershaw" <st***********@yahoo.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
On Aug 18, 4:20 pm, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]"
<St...@Orr.netwrote:
>The body's onload event is raised when the page has been fully loaded. I'm not sure what you mean about "when it receives a response from the web server".
-- I hope this helps, Steve C. Orr, MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net
"Mike McIntyre" <mik...@getdotnetcode.comwrote in message
news:eV**************@TK2MSFTNGP02.phx.gbl...
What event can be used to call a JavaScript function when the page
loads
AND when it receives a response from the web server?
Thanks,
--
Mike
Mike McIntyre [MVP] http://www.getdotnetcode.com- Hide quoted text -
- Show quoted text -
In the Page_Load method use:
string strScript = @"<script language=""javascript"">
window.alert(""put your script here""); </script>";
Page.ClientScript.RegisterStartupScript(typeof(Pag e), "ScriptName",
strScript);
That should do it.
Steve
The Page_Load event fires whenever the Page is requested. I believe that by
"the page gets a response from the server" you are referring to a PostBack.
The Page doesn't get a response from the server. The browser does, every
time it requests a Page. But the Page_Load event fires with each response,
not just the initial (non-PostBack) response.
--
HTH,
Kevin Spencer
Microsoft MVP
DSI PrintManager, Miradyne Component Libraries: http://www.miradyne.net
"Mike McIntyre" <mi****@getdotnetcode.comwrote in message
news:uw**************@TK2MSFTNGP05.phx.gbl...
This seems to fire only when the page is first loaded into the browser -
not each time the page gets a response from the server.
--
Mike
Mike McIntyre [MVP] http://www.getdotnetcode.com
"Steve Kershaw" <st***********@yahoo.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
>On Aug 18, 4:20 pm, "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St...@Orr.netwrote:
>>The body's onload event is raised when the page has been fully loaded. I'm not sure what you mean about "when it receives a response from the web server".
-- I hope this helps, Steve C. Orr, MCSD, MVP, CSM, ASPInsiderhttp://SteveOrr.net
"Mike McIntyre" <mik...@getdotnetcode.comwrote in message
news:eV**************@TK2MSFTNGP02.phx.gbl... What event can be used to call a JavaScript function when the page loads AND when it receives a response from the web server?
Thanks,
-- Mike
Mike McIntyre [MVP] http://www.getdotnetcode.com- Hide quoted text -
- Show quoted text -
In the Page_Load method use:
string strScript = @"<script language=""javascript""> window.alert(""put your script here""); </script>"; Page.ClientScript.RegisterStartupScript(typeof(Pa ge), "ScriptName", strScript);
That should do it.
Steve This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: chirs |
last post by:
I am trying to understand a piece of code. In a javascrpit file,
there is a function:
function ItemStyle(){
var names=;
addProps(this,arguments,names,true);
};
In the html file, it calls...
|
by: Sue |
last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided
to improve character checking on my project. In my project I only had
to do very basic validation. Therefore, I only had one...
|
by: cheezebeetle |
last post by:
ok, so I am having problems passing in an ASPX function into the Javascript in the codebehind page. I am simply using a confirm call which when they press "OK" they call this ASPX function, when...
|
by: JoeK |
last post by:
Hey all,
I am automating a web page from Visual Foxpro. I can control all the
textboxes, radio buttons, and command buttons using syntax such as:
...
|
by: Randell D. |
last post by:
Folks,
I'm sure this can be done legally, and not thru tricks of the trade - I
hope someone can help.
I'm writing a 'tool' (a function) which can be used generically in any
of my projects. ...
|
by: Chris Ianson |
last post by:
Hi geniuses (or is that genii, or genies)
The challenge is as above really. I have a page with an iframe in it, and
need to call a JS function in the *parent* page, *from* inside the iframe.
...
|
by: KaNos |
last post by:
Hi,
"robot script pages" are html+javascript pages, can be played in aspx
player. So in this tech, robot call aspx player's function (an interface is
sheared) and wait a result synchronously with...
|
by: Angus |
last post by:
I have a web page with a toolbar containing a Save button. The Save
button can change contextually to be a Search button in some cases.
Hence the button name searchsavechanges.
The snippet of...
|
by: evicailieva |
last post by:
A have a php scrip where I call a JavaScript function. I don't know why, but it doesn't work. At the beginning, when I was writing the script it was working but now it's not. I don't know wхat to do....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |