Advertisement

05.21.2008 at 02:17PM PDT, ID: 23422572
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

How to pass an array from php to javascript

Asked by yodercm in JavaScript

Tags:

I have a script.js that starts by creating an array as follows;

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="sample1.php">sample1</a>'
menu1[1]='<a href="sample2.php">sample2</a>'
menu1[2]='<a href="sample3.php">sample3</a>'
menu1[3]='<a href="sample4.php">sample4</a>'
menu1[4]='<a href="sample5.php">sample5</a>'

and then sets up a dropdown list using that array.



I need to create this array in php and pass it to the javascript.

In a php script, I create the array:
menu1[0]='<a href="sample1.php">sample1</a>';
menu1[1]='<a href="sample2.php">sample2</a>';
menu1[2]='<a href="sample3.php">sample3</a>';
menu1[3]='<a href="sample4.php">sample4</a>';
menu1[4]='<a href="sample5.php">sample5</a>';

set up the javascript:
<script src="./script.js" type="text/javascript">
</script>

and then use it by:
<a href="" onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, menu1, '500px')" onMouseout="delayhidemenu()">List of Samples</a>


I know virtually nothing about javascript.  How do I change the javascript to use this php-created array instead of the "menu1=new Array()" currently hardcoded in the script.js?Start Free Trial
[+][-]05.21.2008 at 02:24PM PDT, ID: 21619155

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 02:29PM PDT, ID: 21619185

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 02:38PM PDT, ID: 21619249

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 02:52PM PDT, ID: 21619336

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 03:01PM PDT, ID: 21619403

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 03:22PM PDT, ID: 21619543

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 03:35PM PDT, ID: 21619600

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: javascript
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.21.2008 at 03:40PM PDT, ID: 21619626

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 03:51PM PDT, ID: 21619684

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 07:19PM PDT, ID: 21620435

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 05:38AM PDT, ID: 21623173

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 06:02AM PDT, ID: 21623379

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628