Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Tiny problem with onload

Featured Replies

Hello guys

i'm a begginer in HTML/CSS scripting, the problem is that i added some scripts/functions, and i am supposed to add the following in the body tag :

onload= "FunctionName()"

this i was able to do easily, and the script worked fine, however the problem is that i'm trying to add a miltitude of scripts that are triggered onload

it's like "FirstFunction()" 'SecondFunction()" ThirdFunction()"

i tried to add them by repeating the onload signal and the result was that only the first function worked : onload="FirstFunction()" onload="SecondFunction()"

if i tried to add them side by side like onload="Firstfunction()" "Secondfunction()" it returns with an error

i'm totally clueless about what to do so i hope i'm gonna find some help in your forums

thanks in advance :)

Rather than use the archaic inline scripting, opt for the more friendly code:

 

HTML:

<html>
<head><title>Title</title></head>

<body>
<!-- body -->
</body>
</html>

 

<script type="text/javascript">

if(window.addEventListener)
{
   window.addEventListener("load", initialise, false);
}
else
{
   window.attachEvent("onload", initialise);
}

function initialise()
{
   func1();
   func2();
   funct3();

   // etc., etc.
}
</script>

Edited by Sitesupplier

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.