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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:30:57+00:00 2026-06-13T16:30:57+00:00

I have 3 clickable menu items on my page: option1 option2 option3 I also

  • 0

I have 3 clickable menu items on my page:

  • option1
  • option2
  • option3

I also have 3 php files on my server:

  • option1.php
  • option2.php
  • option3.php

To keep things simple, let’s say option1.php echoes the number 1, option2.php echoes the number 2, etc.

To avoid the page refreshing, I want to use AJAX, so when a user clicks option1, option1.php file will display the number 1. I hope I have made myself clear.

What is a good way to do this?

EDIT: I’ve reviewed my question again and have come up with a solution.
In my php file that contains my menu items I added an update area div.

<div id="update_area">
</div>

My external javascript file contains onclick events which call a function that sends the menu item number to be processed by my AJAX php file. This tests my

$_GET[sent_data]

and if (for example) it equals 1, then it uses

require "option1.php";

Now that the functionality is working I can independently edit my option?.php files.

I’ve voted SomeKittens answer as the one that was most helpful.

  • 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-06-13T16:30:58+00:00Added an answer on June 13, 2026 at 4:30 pm

    At some point during your JavaScript code that sends the AJAX data back to the PHP, you’ll need to specify what PHP file you’ll be sending the data to. In vanilla JS, this is the ajaxRequest.open portion. Have your AJAX function take a string parameter (say phpfile) and then use the following snippet to select the php file in your AJAX function:

    ajaxRequest.open("GET", phpfile, true);
    

    Your form elements would have the attrib onclick:

    onClick="myAJAX('option1.php')"
    

    etc, etc.

    http://www.tizag.com/ajaxTutorial/

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

Sidebar

Related Questions

I have a dialog application in which I want to have clickable menu items
Here is my page: http://budclarychevy.com/custom/parts-specials-test My aim is to have the images clickable and
I have been unable to figure out how to keep a context menu open
In a project I'm working on, we have a nav menu where items are
I have a tree that is used as menu, so every node is clickable
I have and app and on my main menu page I want to load
I have a clickable TextView with a drawable as its background. I'm looking for
I have a clickable linear layout that I've generated programmaticly, and I want it
I'm having multiple images (all which are clickable and have a value associated with
On an Android View, I want to have a some clickable text that works

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.