зеркало из https://github.com/mozilla/popcorn-js.git
[#347] Merges context fix and adds multi-context testing
This commit is contained in:
Родитель
a1d6d71d54
Коммит
c0eeeae7b6
|
@ -84,7 +84,7 @@
|
|||
uri += "tags="+tags+"&";
|
||||
}
|
||||
|
||||
uri += "lang=en-us&format=json&jsoncallback=?";
|
||||
uri += "lang=en-us&format=json&jsoncallback=flickr";
|
||||
|
||||
Popcorn.xhr.getJSONP( uri, function( data ) {
|
||||
//$.getJSON( uri, function( data ) {
|
||||
|
|
|
@ -1000,17 +1000,16 @@
|
|||
|
||||
callback = params.length ? ( parts[1] ? parts[1] : parts[0] ) : "jsonp";
|
||||
|
||||
|
||||
if ( !paramStr && !isScript ) {
|
||||
url += "?callback=" + callback;
|
||||
}
|
||||
|
||||
|
||||
if ( callback && !isScript ) {
|
||||
|
||||
// If a callback name already exists...
|
||||
if ( !!window[ callback ] ) {
|
||||
// Create a unique new callback name
|
||||
|
||||
// Create a new unique callback name
|
||||
callback = Popcorn.guid( callback );
|
||||
}
|
||||
|
||||
|
@ -1041,12 +1040,12 @@
|
|||
// Executing for JSONP requests
|
||||
if ( fired || /loaded|complete/.test( script.readyState ) ) {
|
||||
|
||||
// cleanup in here
|
||||
// Garbage collect the callback
|
||||
delete window[ callback ];
|
||||
|
||||
// Garbage collect the script resource
|
||||
head.removeChild( script );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
head.insertBefore( script, head.firstChild );
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
$callback = $_REQUEST['callback'];
|
||||
|
||||
if ( !$callback ) {
|
||||
|
||||
$callback = explode( "?", end( explode( "/", $_SERVER['REQUEST_URI']) ) );
|
||||
$callback = $callback[0];
|
||||
|
||||
}
|
||||
|
||||
echo $callback . '({ "data": {"lang": "en", "length": 25} });';
|
||||
|
||||
?>
|
Загрузка…
Ссылка в новой задаче