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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:49:09+00:00 2026-05-18T23:49:09+00:00

I was wondering how i could achieve using <?php?> in javascript for url’s? There’s

  • 0

I was wondering how i could achieve using <?php?> in javascript for url’s? There’s a certain route you have to go, Anyone know?

the normal way for example:

$fetchContent = $('#div').load('website/members #content');

What i’m trying to do:

$fetchContent = $('#grav').load('<?php?> #poppu');

Yep, thats wrong as hell lol, but i’m sure someone knows

I would also like to know how to tie php with javascript, but thats probably a whole new topic

  • 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-18T23:49:10+00:00Added an answer on May 18, 2026 at 11:49 pm

    You said it right 🙂

    Yep, thats wrong as hell lol, but i’m
    sure someone knows

    Anyway, from your php script, output the url as a javascript code anywhere in the script before the javascript used for ajax call, e.g.

    <?php
        echo '<script language="javascript"> var g_ajax_url = "'. $the_url . '";</script>';
    ?>
    

    and in your javascript, use it this way

    $fetchContent = $('#grav').load(g_ajax_url + ' #poppu');
    

    What it simply does is define g_ajax_url as a global variable with the proper php value, and you can use that variable in your js as you use other variables.

    To tie php with js directly, try looking into xmlrpc topic.

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

Sidebar

Related Questions

just wondering if anyone could suggest why I might be getting an error? I'm
I was wondering if anyone could point to an Open Source date utility class
I'm relatively new to ASP.NET and was wondering if anyone could shed some light
I've got an issue that was wondering if could be solved in a particular
I was wondering if I could pop up JOptionPane s or other Swing components
I'm wondering how one could use template databinding to accomplish what the following code
I was just wondering how I could automatically increment the build (and version?) of
I ran across this and was wondering if someone could explain why this works
I saw this tip in another question and was wondering if someone could explain
I've recently found out about protocol buffers and was wondering if they could be

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.