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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:31:16+00:00 2026-05-26T21:31:16+00:00

i have a script that i use to load some content: <script> $(.link_image).click(ajax_request); function

  • 0

i have a script that i use to load some content:

<script>
$(".link_image").click(ajax_request);
function ajax_request() {
    $('#placeholder').load("../test.php?id=1234556");
}
</script>

this will load test.php into my div. but what if i want to load a function that is inside test.php:

get_title();

any ideas?

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-26T21:31:17+00:00Added an answer on May 26, 2026 at 9:31 pm

    You cannot call php functions from javascript as the PHP processing happens before the javascript is outputted to the page. (Basically the PHP script is no longer running when the client sees the page)

    What you can do is get the output of that function using AJAX, and then use javascript to put the result wherever you want. Ask if you have any further questions.

    EDIT: To be more specific, you can create a php file that essentially does

    echo get_title();
    

    and load that to get the output of get_title().

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

Sidebar

Related Questions

I have a Ruby script in my Rails app that I use to load
I have a document that loads some content into a div with JQuery's .load()
I have a script that makes use of a package (PKG_MY_PACKAGE). I will change
I have a script like that genhash --use-ssl -s $IP -p 443 --url $URL
I have a script that uses $(document).ready , but it doesn't use anything else
I have a Perl script I wrote for my own personal use that fetches
I have some awk scripts that use gawk from cygwin. Now I need to
I am trying to send a php script some content to be stored in
I have these pages: information.php <div id='content'>Foo Bar</div> main.php <div id='main'></div> <script type=text/javascript> $(document).ready(function()
I have some code that looks something like this: <head runat="server"> <script type="text/javascript"> var

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.