Verán, tengo un PHP que otro archivo HTML interpreta como Javascript, para ello uso $.getScript.
Antes solo necesitaba obtener información del PHP como una variable de Javascript, pero ahora necesito enviar un argumento al PHP.
Para explicarme mejor os dejo un ejemplo:
Código Javascript:
Ver original
function newVideo() { $.getScript('videoInfo.php', function() { obtainInfo(); }); }
El Javascript que genera "videoInfo.php" sería este:
Código Javascript:
Ver original
videoInfo = {"apiVersion":"2.0","data":{"updated":"2010-12-12T06:03:24.000-08:00","totalItems":99,"startIndex":21,"itemsPerPage":1,"items":[{"id":"_NR16JHMWqY","uploaded":"2010-11-12T18:07:55.000Z","updated":"2010-12-12T09:35:56.000Z","uploader":"greyson97","category":"Music","title":"Greyson Chance - MyYouTube","description":"Greyson Chance - MyYouTube","tags":["Greyson Chance","MyYouTube","Ellen DeGeneres","Waiting Outside The Lines","Video Shoot","Set"],"thumbnail":{"sqDefault":"http://i.ytimg.com/vi/_NR16JHMWqY/default.jpg","hqDefault":"http://i.ytimg.com/vi/_NR16JHMWqY/hqdefault.jpg"},"player":{"default":"http://www.youtube.com/watch?v\u003d_NR16JHMWqY&feature\u003dyoutube_gdata_player"},"content":{"5":"http://www.youtube.com/v/_NR16JHMWqY?f\u003dstandard&app\u003dyoutube_gdata"},"duration":24,"aspectRatio":"widescreen","rating":3.09,"likeCount":"150","ratingCount":287,"viewCount":41695,"favoriteCount":23,"commentCount":314,"status":{"value":"restricted","reason":"limitedSyndication"},"accessControl":{"syndicate":"denied","commentVote":"allowed","rate":"allowed","list":"allowed","comment":"allowed","embed":"allowed","videoRespond":"moderated"}}]}}
Y claro, ahora necesito hacer una petición del tipo:
videoInfo.php?search=VARIABLE
¿Sería esto posible con $.getScript?
En caso de no serlo ¿qué otras alternativas tendría?
Saludos.