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 6910669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:50:40+00:00 2026-05-27T08:50:40+00:00

I am working on this test page: http://www.problemio.com/index_new.php and you see the categories that

  • 0

I am working on this test page: http://www.problemio.com/index_new.php and you see the categories that are listed. They have associated sub-categories.

So what I want to have happen is if a person mouses-over on “Health” I want to present them with a list like:

- Personal Health
- Healthcare
- Diet
- Exercise

and there is a different sub-list for each category.

So my question is – since mouseOver looks like this: onmouseover="SomeJavaScriptCode"

I will likely have to call a JavaScript function, correct? If so, how do I populate the JS with the data from my PHP query? Should I create the JS during from my PHP since the data is dynamic? What approach is the best here?

Thanks!!

  • 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-27T08:50:40+00:00Added an answer on May 27, 2026 at 8:50 am

    The approach that is commonly used is to get the data in php, call json_encode to make the object in javascript then have separate scripts which will handle the user interaction keeping the data separate from the behavior. In javascript to get the object make the call shown here and then you can do whatever you want in javascript.

    you can do this in php

    print "<script>";
    print "var myObject = eval('".json_encode($data)."');"
    print "</script>";
    

    and then the data is in javascript for other scripts do display as they like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on this test page: http://www.problemio.com/test.php If you click the login link,
I have this test page I am working from: http://www.problemio.com/test.php The problem happens when
I am working off this test page: http://www.comehike.com/test_fb_connect.php When the user logs in using
I am working on the following page. http://www.ranger.ryerson.ca/library/test/steveDev/testcarousel/test.html it works in firefox, chrome, and
Even using the default test code on my app I can't get this working.
Ok, so this was working in my VS test server (naturally), but as soon
I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
I do not get the last version of node-http-proxy working (this used to work
I asked this morning a question about a jQuery code that's not working (which
I am working an a test page to get the Facebook login button functionality

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.