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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:18:37+00:00 2026-05-30T05:18:37+00:00

The client website needs to do a cross-domain JQuery Ajax call to a php

  • 0

The client website needs to do a cross-domain JQuery Ajax call to a php file on my server, the php file will query the database for a bunch of stored javascripts which then need to be sent back to the client and be executed on the client’s website. This is what i have so far, haven’t done the grabbing javascript from database yet and it works. Is this the best way to do this (assuming i can grab the javascripts directly from the database without adding the escape sequence when echo’ing back to the client)? Thanks.

This is what i have so far:

 client side:
      $.ajax({ url: "http://localhost:8888/test.php",
      dataType: "script",
      });

 server side (test.php):
      <?php
      echo "alert(\"WORKS!\");";
      ?>
  • 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-30T05:18:39+00:00Added an answer on May 30, 2026 at 5:18 am

    Review the ajax documentation and handle the success callback option on the ajax method:

    $.ajax({
        url: "http://localhost:8888/test.php",
        dataType: "html",
        success : function(data) { alert(data); }
    });
    

    As noted by Ricardo, your PHP script should echo HTML or some other content appropriate for your scenario.

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

Sidebar

Related Questions

website needs to go live which i have placed on client server.i have gven
We need to build an administration portal website to support our client/server application. Since
In our client's website , favicon.ico file has several sizes from 8x8 to 32x32.
Situation: I am creating a database user interface for a client's website. I know
I have set up an AJAX contact form on a client's website. The problem
The problem: client needs a website to serve 10+ customers, each customer has 5-10
I have an existing PHP website which uses a considerable amount of jQuery and
I'm working on a project that involves a database (My SQL), website (PHP) and
I'm working on a website for a client, in PHP/MySQL. They are a publisher,
My goal is to create a website for a client that needs the site

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.