Triggering Javascript Onload Action From Arduino

Basically all I need it to do is load the html page for on and off and trigger the Javascript OnLoad action when a button connected to the Arduino is pressed. Any ideas how to accomplish this? I have the Arduino connected to my network using the ethernet shield.

I would not recommend this way to solve your problem because that would mean that your Arduino needs to execute JavaScript and this little computer is not able to do that.

It's better that you look at the code that is executed in that onLoad action and do the same but using the program on your Arduino.

We cannot help you at the moment because you haven't provided the script or HTML page that is delivered by your server.

You also didn't specify which hardware you plan to use on the Arduino side.