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