473,796 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looking for an event trigger

I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?

Oct 11 '06 #1
15 1924
Clever...@hotma il.com napisal(a):
I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?
You can do it using AJAX. Put some java script code into page which
will make a request to your server when page is loaded to inform PHP
script that whole page's been loaded.

Oct 11 '06 #2
ASM
Cl*******@hotma il.com a écrit :
I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?
<script type="text/javascript">

function sthg() {
document.body.s tyle.background ='orange';
}

onload = function() { sthg(); alert('all loaded'); };
</script>
does alert fires before all images loaded ?
Oct 11 '06 #3
Cl*******@hotma il.com wrote:
I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?
Are you looking to execute some code on the server or the client? What
are you actually trying to do?

Remember - PHP is server side only. It has no direct contact with the
client. All it knows is when it's passed its data off to the web server
for sending to the client. It doesn't know what happens after that -
not even if the browser is closed or the connection dropped before the
page completed loading.

You can do it in Javascript on the client, and as Mateusz indicated you
can use AJAX to call a function back on the server.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Oct 11 '06 #4

ASM wrote:
Cl*******@hotma il.com a écrit :
I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?

<script type="text/javascript">

function sthg() {
document.body.s tyle.background ='orange';
}

onload = function() { sthg(); alert('all loaded'); };
</script>
does alert fires before all images loaded ?
No, onload for the document fires when the HTML file is loaded. Img
tags have their own onload handlers. AFAIK not events are emitted on
things like background images.

Oct 11 '06 #5

Jerry Stuckle wrote:
Cl*******@hotma il.com wrote:
I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?

Are you looking to execute some code on the server or the client? What
are you actually trying to do?

Remember - PHP is server side only. It has no direct contact with the
client. All it knows is when it's passed its data off to the web server
for sending to the client. It doesn't know what happens after that -
not even if the browser is closed or the connection dropped before the
page completed loading.

You can do it in Javascript on the client, and as Mateusz indicated you
can use AJAX to call a function back on the server.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
I was hoping to redirect the client to the next page once the first had
been loaded, so I guess some clientside javascript would be sufficient?

Oct 11 '06 #6
Cl*******@hotma il.com wrote:
Jerry Stuckle wrote:
>>Cl*******@hot mail.com wrote:
>>>I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?

Are you looking to execute some code on the server or the client? What
are you actually trying to do?

Remember - PHP is server side only. It has no direct contact with the
client. All it knows is when it's passed its data off to the web server
for sending to the client. It doesn't know what happens after that -
not even if the browser is closed or the connection dropped before the
page completed loading.

You can do it in Javascript on the client, and as Mateusz indicated you
can use AJAX to call a function back on the server.

--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@att global.net
============= =====


I was hoping to redirect the client to the next page once the first had
been loaded, so I guess some clientside javascript would be sufficient?
You could, but then why even load the first page? It will just flash up
there then go to the next page.

If I were the client I would be very upset about this.

But if you insist, you can do it with an html redirect. Check the
alt.html newsgroup for help on how to do it.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Oct 11 '06 #7

Jerry Stuckle wrote:
Cl*******@hotma il.com wrote:
Jerry Stuckle wrote:
>Cl*******@hotm ail.com wrote:

I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?
Are you looking to execute some code on the server or the client? What
are you actually trying to do?

Remember - PHP is server side only. It has no direct contact with the
client. All it knows is when it's passed its data off to the web server
for sending to the client. It doesn't know what happens after that -
not even if the browser is closed or the connection dropped before the
page completed loading.

You can do it in Javascript on the client, and as Mateusz indicated you
can use AJAX to call a function back on the server.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attg lobal.net
============== ====

I was hoping to redirect the client to the next page once the first had
been loaded, so I guess some clientside javascript would be sufficient?

You could, but then why even load the first page? It will just flash up
there then go to the next page.

If I were the client I would be very upset about this.

But if you insist, you can do it with an html redirect. Check the
alt.html newsgroup for help on how to do it.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Well the first page does the processing that the second page needs
before it can be displayed, the processing is done by pages loaded
within image tags, there are over 4,000 of them and the processing time
will obviously vary, hence why I wanted the trigger to activate once
the page and all the images had loaded.

Oct 12 '06 #8
Cl*******@hotma il.com wrote:
Jerry Stuckle wrote:
>>Cl*******@hot mail.com wrote:
>>>Jerry Stuckle wrote:
Cl*******@h otmail.com wrote:
>I'm hoping to execute some code "when the page has completely finished
>loading" by which I mean the page and all the images on it, does anyone
>know of a way to do this?
>

Are you looking to execute some code on the server or the client? What
are you actually trying to do?

Remember - PHP is server side only. It has no direct contact with the
client. All it knows is when it's passed its data off to the web server
for sending to the client. It doesn't know what happens after that -
not even if the browser is closed or the connection dropped before the
page completed loading.

You can do it in Javascript on the client, and as Mateusz indicated you
can use AJAX to call a function back on the server.

--
=========== =======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@a ttglobal.net
=========== =======
I was hoping to redirect the client to the next page once the first had
been loaded, so I guess some clientside javascript would be sufficient?

You could, but then why even load the first page? It will just flash up
there then go to the next page.

If I were the client I would be very upset about this.

But if you insist, you can do it with an html redirect. Check the
alt.html newsgroup for help on how to do it.


Well the first page does the processing that the second page needs
before it can be displayed, the processing is done by pages loaded
within image tags, there are over 4,000 of them and the processing time
will obviously vary, hence why I wanted the trigger to activate once
the page and all the images had loaded.
OK, I understand the pages doing the processing. But why would you send
any data to the client if it's not meant to be seen, anyway?

And in a case like that, why would you care if the page is loaded or not?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Oct 12 '06 #9

Jerry Stuckle wrote:
Cl*******@hotma il.com wrote:
Jerry Stuckle wrote:
>Cl*******@hotm ail.com wrote:

Jerry Stuckle wrote:
Cl*******@ho tmail.com wrote:
I'm hoping to execute some code "when the page has completely finished
loading" by which I mean the page and all the images on it, does anyone
know of a way to do this?
Are you looking to execute some code on the server or the client? What
are you actually trying to do?

Remember - PHP is server side only. It has no direct contact with the
client. All it knows is when it's passed its data off to the web server
for sending to the client. It doesn't know what happens after that -
not even if the browser is closed or the connection dropped before the
page completed loading.

You can do it in Javascript on the client, and as Mateusz indicated you
can use AJAX to call a function back on the server.

--
============ ======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@at tglobal.net
============ ======
I was hoping to redirect the client to the next page once the first had
been loaded, so I guess some clientside javascript would be sufficient?
You could, but then why even load the first page? It will just flash up
there then go to the next page.

If I were the client I would be very upset about this.

But if you insist, you can do it with an html redirect. Check the
alt.html newsgroup for help on how to do it.

Well the first page does the processing that the second page needs
before it can be displayed, the processing is done by pages loaded
within image tags, there are over 4,000 of them and the processing time
will obviously vary, hence why I wanted the trigger to activate once
the page and all the images had loaded.

OK, I understand the pages doing the processing. But why would you send
any data to the client if it's not meant to be seen, anyway?

And in a case like that, why would you care if the page is loaded or not?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
The page needs to finish loading for all of the processing to complete.
Each image on the first page corresponds to a certain portion of the
work that needed doing before the second page is shown. If the second
page is shown before the first one is finished the information on it
will be wrong.
I've done the data processing this way as my host has a maximum
execution time of 30 seconds and only supports web languages - not
things like java/c.
The images also show information about what happened in the process,
which is useful for debugging, but will most likely be ignored by the
client.

Oct 12 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
17519
by: R. Rajesh Jeba Anbiah | last post by:
I have Googled a lot, but couldn't still find the answer... I could see, I can trigger the "click" event like: button_object.Click() But, I need to trigger the onChange() of select options. I couldn't find anything like: select_object.Change() More specifically, I have something like:
3
6832
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to figure out, if there is a way of using polymorphic way (if that is a word) of doing this particular property. A sample of my code is as follows: DynamicControls.ButtonControl(this,btnSearchByName, new Point(5, 75), new Size(95, 20),...
4
4019
by: Peter Lin | last post by:
Dear all; I need to monitor a xml file so that I can update my data in hashtable, but the problem is it will trigger more than one event for a lastwrite action(I trigger this action by add something in the xml file using notepad). Here is my codes about using FilesystemWatcher fileWatcher=new FileSystemWatcher(); fileWatcher.Path=System.Environment.CurrentDirectory; fileWatcher.NotifyFilter=NotifyFilters.LastWrite;
2
3980
by: Owin | last post by:
Hi all, I've created an User control. It's an extension of a textbox wich has some extra properties so that validation becomes a lot faster. The control wordks great if autopostback is on. When there's a value in the textbox, the (overridden) textchanged event fires and validation is performed. Now I want to turn off autopostback. So I want my contol only validate if the submit button is pressed. I've tried Page.Validate(), but It seems...
8
2358
by: Steve Schroeder | last post by:
For some reason I cannot get the OnSelectedIndexChanged event to fire for a listbox I have on a page. I'm able to populate the listbox with data from a stored procedure, but cannot trigger the event. I do have EnableViewState = True for the listbox. I'm imagining (wanting) to populate the listbox named: lstNames by using the DataValueField from lstDepartments. It's quite apparent though that the event is not triggering as I can misname...
3
1625
by: rmorvay | last post by:
I allow users to click a datagrid row and it spawns another browser page to allow edits to the data in that row. Once they update the data, it is committed to the database and the form is closed. Once the edit page is closed, I need to trigger the search button click event in order to refresh the datagrid with the original search criteria. I cannot figure out how to trigger the Button1_ServerClick event of the main page from the called...
2
9513
by: cumars | last post by:
Hello Friends, I want to trigger both the click event and double click event in a single button separately. (i.e.) the user can trigger both the single click and the double click event. if they click once, it should trigger single click event. if they click twice, it should trigger double click event. please Help. Cumars
16
1529
by: Cleverbum | last post by:
I'm hoping to execute some code "when the page has completely finished loading" by which I mean the page and all the images on it, does anyone know of a way to do this?
4
1844
by: LyzH | last post by:
Someone else had a question on how to emulate a mouse click. I tried posting in that thread but I have something of a twist on this problem and I'm really in trouble here! If I don't get help soon, I'm going to fail this class and the class is already dragging down my GPA. I'm taking an introductory visual basic class with an advanced visual basic book and assignments (the department dropped the prerequisite and the class needs one....
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10244
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10201
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.