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

  • Home
  • SEARCH
  • 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 102141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:54:23+00:00 2026-05-11T00:54:23+00:00

I have a problem in integrating PHP and JQuery: My main file is MyFile.html

  • 0

I have a problem in integrating PHP and JQuery:

My main file is MyFile.html and the AJAX call file is ajax.php.

The ajax.php function returns links to myFile.html as

<a href Link.php?action=Function ></a> (i.e echo ' <a href Link.php?action=Delete';)

When I click the returned link from MyFile.html it’s performing as expected. I need how to modify the equivalent code to work correctly in Myfile.Html.

My motivation is that the ajax.php return link should work in HTML.

Any ideas?

  • 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. 2026-05-11T00:54:23+00:00Added an answer on May 11, 2026 at 12:54 am

    It sounds like you are trying to simply set the contents of an HTML element to the result of executing a PHP script. Here is a sample PHP script that will just print an HTML link depending on what parameter you pass it in the ‘foo’ parameter.

    <?   // Get the parameter 'foo' from the URL string.   $action = $_GET['foo'];    // Return a different link depending on what 'foo' is.   switch ($action) {     case 'a':       print('<a href='Link.php?action=Delete'>Delete</a>');       break;     case 'b':       print('<a href='Link.php?actiom=Edit'>Edit</a>');       break;     default:       print('<a href='Link.php?action=New'>New</a>');       break;   } ?> 

    Now you need to load that PHP script from inside your HTML file using Javascript (jQuery). Here is a simple page demonstrating that.

    <html> <head> <title>Demo Page</title> <script type='text/javascript' src='js/jquery.js'></script> <script type='text/javascript'>   $(function() {     $.get('ajax.php?foo=a', function(data) {       $('#result').html('Received response: ' + data);     });   }); </script> </head> <body> <!-- This div will contain a link to the 'Delete' --> <div id='result'/> </body> </html> 

    Some things to remember:

    1. This demo assumes the ‘ajax.php’ and ‘demo.html’ files are in the same directory.
    2. It is also assumed you have the jQuery Javascript file located in a file called ‘jquery.js’ in a directory called ‘js’.
    3. You need to run this example from a live web server. In other words, this will not work if you put these files on your desktop and open ‘demo.html’ in a web browser. There are two reasons for this. Security restrictions in modern browsers often times prevent AJAX calls from local files. Also, the PHP page will not run, rendering the whole exercise useless.

    Here is the directory structure you should have, assuming /www/data is the root directory of your web server’s files:

    • /www/data/demo.html
    • /www/data/ajax.php
    • /www/data/js/jquery.js
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer No, there's no equivalent of typedef (which I think is… May 11, 2026 at 11:09 am
  • added an answer The answer probably depends how critical it is for you… May 11, 2026 at 11:09 am
  • added an answer while (node.hasChildNodes()) { node.removeChild(node.lastChild); } May 11, 2026 at 11:09 am

Related Questions

I have a problem in integrating PHP and JQuery: My main file is MyFile.html
I have a problem in my project with the .designer which as everyone know
I have a problem in giving Ajax functionality to a hyperlink. I have files
I have a problem in a Windows Forms application with Bitmap.Save failing when I
I have a problem in my C# ASP.NET application, where the id and name
I have a problem with a string in C++ which has several words in
I have a problem wih a logging setup in a apring webapp deployed under
I have a problem with a memory leak in a .NET CF application. Using
I have a problem drawing something quickly in .NET. I don't think that any
I have a problem using the Java search function in Eclipse on a particular

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.