Mukhtar
21.08.2012, 01:46
Доброе утро или ночи.
Голова уже не варит совсем, помогите разобраться?
Я пишу ajax загрузку видео на youtube, используя youtube api.
На ютуб видео сохраняется, не могу закинуть в базу, точнее могу, но у меня запрос зацикливается.
вот код
jQuery('#buttonUpload').click(function(event) {
event.preventDefault();
var user_id = jQuery("#v_userid").val();
var title = jQuery("#v_title").val();
var description = jQuery("#v_description").val();
var category = jQuery("#v_category").val();
var keywords = jQuery("#v_keywords").val();
var action = 'postVideo';
jQuery.uploadVideo("/include/js/connect.php", "fileToUpload",
{ title: jQuery("#v_title").val(),
description: jQuery("#v_description").val(),
category: jQuery("#v_category").val(),
keywords: jQuery("#v_keywords").val()},
function (){
jQuery("#loader").html("<p><img src='include/js/ajax-loader.gif'>Идет загрузка</p>");
},
function (data){
if(data.id!=1){
jQuery.ajax({
type: "POST",
url: "./include/functions.php",
data: {action:action, user_id:user_id, status: status, id: id, title:title, description:description, category:category, keywords:keywords},
cache: false,
success: function(response){alert(response);}
});
}else{
jQuery("#loader").html("<p>Видео не загружено</p>");
}
});
});
Помогите пожалуйста
Голова уже не варит совсем, помогите разобраться?
Я пишу ajax загрузку видео на youtube, используя youtube api.
На ютуб видео сохраняется, не могу закинуть в базу, точнее могу, но у меня запрос зацикливается.
вот код
jQuery('#buttonUpload').click(function(event) {
event.preventDefault();
var user_id = jQuery("#v_userid").val();
var title = jQuery("#v_title").val();
var description = jQuery("#v_description").val();
var category = jQuery("#v_category").val();
var keywords = jQuery("#v_keywords").val();
var action = 'postVideo';
jQuery.uploadVideo("/include/js/connect.php", "fileToUpload",
{ title: jQuery("#v_title").val(),
description: jQuery("#v_description").val(),
category: jQuery("#v_category").val(),
keywords: jQuery("#v_keywords").val()},
function (){
jQuery("#loader").html("<p><img src='include/js/ajax-loader.gif'>Идет загрузка</p>");
},
function (data){
if(data.id!=1){
jQuery.ajax({
type: "POST",
url: "./include/functions.php",
data: {action:action, user_id:user_id, status: status, id: id, title:title, description:description, category:category, keywords:keywords},
cache: false,
success: function(response){alert(response);}
});
}else{
jQuery("#loader").html("<p>Видео не загружено</p>");
}
});
});
Помогите пожалуйста