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.

Simon Parker

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Simon Parker reacted to Nillervision in Javascript and examples of functions   
    Regarding your confusion on build in functions: All programming languages have build in functions/methods.
    The main difference between build in and custom functions is that you don’t have to declare the build in functions you will only call them.
    The syntax for calling a build in function is the same as if you were calling a custom function.
    Build in functions also only take a certain amount of parameters. If you use the build in “alert” function it takes only one parameter which is the actual text you
    wish to print.
    So using custom functions is a two-step process.

    Step 1 declaring the function. You do that by using the function keyword followed by parameter brackets and curly brackets for the function body (code to execute):
    function myFunc(myParameter) { alert (myParameter); //some other code to execute can be placed here } (Note that we have a build in function inside our custum function)
     
    Step 2 caling the function (usually from an event or after a series of commands.)
    In this example we are calling the function from the window.onload event and passing a parameter (the text-string)
     
    window.onload = myFunc('window has loaded'); We can reuse the function as much as we want from other events and we can pass other values to the parameters (in this example from a resize event)
    window.onresize = myFunc('the window is resized'); Edit: In the example here we might as well just call the build in alert function with the same paremeter as the result would be the same but a custum fuction can be very handy for more advanced stuf like having comparison operators:
    function myAdvancedFunc(myParameter, myOtherParameter) { if (myOtherParameter == 100) { alert (myParameter); } }  
    And call it like this
    window.onload = myFunc('window has loaded', 100);

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.