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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:19:01+00:00 2026-05-25T14:19:01+00:00

I have a php file, which accesses memcache and gets a stored javascript code.

  • 0

I have a php file, which accesses memcache and gets a stored javascript code. This file then echoes the js content. I am using iFrame to access this file. But now there is a requirement to get this JS code without using iFrame. I am thinking of making a AJAX call and get that js code. The problem is that, that php file is cross domain. I learnt that ajax can’t operate cross browser. JSONP holds the answer. But I don’t know syntax. I checked a lot of documents but couldn’t figure out how to do it.

This is my php file memcacheJs.php:

$id        =  $_GET['mc_id'];
$js_code   =  $memcacheRW->get($id);
echo          $js_code;
$memcacheRW -> delete($id);

I have to call this file, sending mc_id, get that js_code as ajax response. I tried this code of jquery:

var jsCode      = "js_code="+_cO.cmK[keyword].ad[0][4];
var crossDomURL = "http://ph.cm.shades1ld1/frame2.php";

$pH.getJSON(crossDomURL+"&callback=?", function(data) {alert(data);});

But it’s not working, what to do ?
Please help

  • 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-25T14:19:02+00:00Added an answer on May 25, 2026 at 2:19 pm

    You have to match the callback function, look at the jsonpCallback param. Here is an working example using jsonP (simplified).

    $.ajax({
            url: "/myUrl.php",
            data: {
                'date' : '2011-01-01', 
                'specie' : 'cervus'
            }, 
            dataType : 'jsonp',
            jsonpCallback: 'onModify',
            success: function(data){
                console.log(data);
                return false;
             }
        });
    
    //the php code 
    $data = array('some', 'values', 'in','response');
    echo "onModify(". json_encode($data).")";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php file which I will be using as exclusively as an
I have a PHP file which has the following text: <div class=small_italic>This is what
I have a PHP file which returns this: $data = pg_fetch_array($result); echo json_encode($data); And
I have folliwing PHP file which is creating this table: Table createb by PHP
I have an index.php file which has to process many different file types. How
This is driving me crazy. I have this one php file on a test
I have written jQuery code, in files Main.html and ajax.php . The ajax.php file
I have a script which generates an XML file when the user accesses the
The situation is next: I have php file, which parses a web-page. on that
I have a php file which prints an xml based on a MySql db.

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.