我想解决这个问题,但到目前为止我还不能解决这个问题。我的iPhone必须单击两次以显示Facebook App的Ajax好友选择器。第一次单击仅显示背景色调,我必须单击色调将其删除,第二次单击显示朋友选择器jquery.friend.selector-1.2.js。 Android手机似乎正在运转。如果有人知道如何解决这个问题会很棒。
<script type="text/javascript">
function logResponse(response) {
if (console && console.log) {
console.log('The response was', response);
}
}
var friends = [];
$(function(){
FB.init({
appId : '<?php echo AppInfo::appID(); ?>', // App ID
channelUrl : 'https://<?php echo $_SERVER["HTTP_HOST"]; ?>/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.Canvas.setAutoGrow(200);
FB.Canvas.scrollTo(0,0);
FB.Canvas.setSize({width: 810, height: 1000});
var i = 0;
$(".selectFriend").click(function(e){
var selector = $(this);
// init new selector
selector.fSelector({
max: 5,
closeOnSubmit : true ,
onSubmit: function(response){
if(response){
// to rest old selected
var friend = $('.selectedFriendNames').attr('id');
var friendname = $('.selectedFriendNames').val();
var match = jQuery.inArray(friend,friends);
if($('.selectedFlower') && match >= 0){
//commented out for testing
//reduce count
//i--;
/*friends.splice(match,1);
$('.selectFriend').show();
$('.selectedFlower').find('.selectedFriendClass').html('');
$('.selectedFlower').find('#flowerName').removeAttr( 'style' );
$('.selectedFlower').find('.description').removeAttr( 'style' );
$('.selectedFlower').find('.comment').html('');
$('.selectedFlower').removeClass("selectedFlower");
$('#selections').val('');
$('#image').val('');
$('#icon').val('');
$('#desc').val('');
$('#fdesc').val('');
*/
}
i++;
var selections = response.join(',');
$.post('renderSelectedUsers.php',{selections: selections,id:i},function(resp) {
selector.closest('li').find('.selectedFriendClass').html(resp);
selector.closest('li').find('.description').css("position", "relative");
selector.closest('li').find('#flowerName').css("position", "absolute");
selector.closest('li').find('#flowerName').css("top", "10px");
selector.closest('li').find('#flowerName').css("left", "40px");
selector.closest('li').find('.comment').html("<textarea name ='comment" + i + "' id= 'comment' placeholder= 'message!'/>");
$('#selectedFriendsHtml' + i).val(resp);
$('#count').val(i);
selector.closest('li').find('.username').html($('.selectedFriendNames').html());
friends.push($('.selectedFriendNames').attr('id'));
var desc = selector.closest('li').find('p').first().text();
var fdesc = selector.closest('li').find('.forConfirm').html();
selector.closest('li').addClass("selectedFlower");
var image_to_post = "<?php echo AppInfo::getUrl(); ?>"+selector.closest('li').find('img').first().attr
("src");
var image = "<?php echo AppInfo::getUrl(); ?>"+selector.closest('li').find('.icon img').attr
("src");
var icon = "<?php echo AppInfo::getUrl(); ?>"+selector.closest('li').find('#flowerName').attr
("src");
$('#selections' + i).val(selections);
$('#image' + i).val(image);
$('#icon' + i).val(icon);
$('#desc' + i).val(desc);
$('#fdesc' + i).val(fdesc);
$('#imageToPost' + i).val(image_to_post);
});
selector.hide();
}
}
});
});
});
function submitForm(){
if( $('#selections').val() !='' && $('#comment').val() !='' )
$('#flowerForm').submit();
else{
alert("Select Friends");
}
}
</script>