Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5953359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:48:52+00:00 2026-05-22T17:48:52+00:00

I am setting up the following code to allow me decide which JS functions/files

  • 0

I am setting up the following code to allow me decide which JS functions/files to run based on conditional PHP echos to the array given. For some reason I seem unable to retrieve the contents of the array in the Javascript code given:

HTML

<!-- add functions to run at window.onload here -->
<script type="text/javascript">
on_multiload [0] = "message";
on_multiload [1] = "message2";

</script>

<script type="text/javascript" src="http://www.ondesign.org.uk/wp-content/plugins/on-dev-kit/js/pageload.js"></script>

JS

window.onload = function () {
    on_multiFunction_load (on_multiload);
}

function on_multiFunction_load (on_multiload) {
    for (var i = 0; i< on_multiload.length; i++) {
        alert (on_multiload[i]);
    }
}

Can anyone see what I’ve done wrong (first time loading js variables from an external source, so it’s likely to be simple)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:48:53+00:00Added an answer on May 22, 2026 at 5:48 pm

    You are trying to assign values to properties of on_multiload while on_multiload is undefined.

    var on_multiload = [];
    on_multiload[0] = "message";
    on_multiload[1] = "message2";
    

    or

    var on_multiload = [ "message", "message2" ];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: private static void WriteStartupInfo() { Settings settings = Settings.Default;
If I have the following setting in my app.config file. It is a setting
i've got the following linq2sql query, and i'm setting the result to a POCO.
Assuming a Read Committed Snapshot transaction isolation setting, is the following statement atomic in
Setting up a Windows based web application on Amazon's cloud has definitely been a
I'm building a pseudo-variable parser in PHP to allow clean and simple syntax in
I'm stuck with the following bit of code. NSString *gridRef = [[NSString alloc] initWithFormat:
I've got the following settings in my postgres conf: log_destination = 'stderr' redirect_stderr =
I need to know the default port settings for the following services SQL Server
We’re getting the following error message when we click on Search Settings for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.