Facebook的弹出系统与评论功能 [英] Facebook popup system with commenting feature
问题描述
上面的图片显示了一个样本弹出完全相同的Facebook上。但见rightside我想包括注释功能。 您可以查看演示<$c$c>http://www.jqueryscript.net/demo/Creating-A-Image-Viewer-with-Descriptions-Like-Facebook-jQuery-FBPhotoBox/$c$c>
Above image shows a sample popup exact same as Facebook. But See rightside i want to include Commenting feature.
You can Check demo at http://www.jqueryscript.net/demo/Creating-A-Image-Viewer-with-Descriptions-Like-Facebook-jQuery-FBPhotoBox/
这将是类似于以下。
从上面的图片,我打算做使用Ajax评论功能。我的弹出是工作,但在谈到不工作,甚至我没有得到一个特定图像的 ID
。
我的评论code工作在另一页,但不是在这一侧。 THS code也有助于寻找使用AJAX评论。
It will be look like below.
From the above image, I am intended to do commenting feature using Ajax. My popup is working but commenting not working, even i didn't get the id
of a particular image.
My commenting code working on another page but not in this side. Ths code also helps looking for commenting using ajax.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(function(){ $('#insert').click(function()
{
var jname = $('#fname').val();
var jcomment = $('#comment').val();
if($('#fname').val()=="")
{
alert("Name cannot be Blank");
}
else{
$.post('data.php',{action: "insert", name:jname, comment:jcomment},function(res){
$('#result').html(res);
}); }
});
$('#show').click(function(){
$.post('data.php',{action: "show"},function(res){
$('#result').html(res);
});
});
});
Your Name: <input type="text" id="fname">
Comment:<textarea id="comment" ></textarea>
<button id="insert" value="comment">Comment</button>
<div id="result"></div>
而 data.php
将插入和结果将在&LT显示,DIV ID =结果&GT;&LT; / DIV&GT;
我的问题是如何创建使用给定的工作阿贾克斯code评论功能,右侧弹出窗口。
And the data.php
will insert and result will show in <div id="result"></div>
My question is how i create commenting feature on right side of popup window using the given working ajax code.
良好的帮助是很大的AP preciated。谢谢
Good Helps are greatly appreciated. Thanks
推荐答案
修正
$(function(){ $('#insert').click(function()
{
var jname = $('#fname').val();
var jcomment = $('#comment').val();
if($('#fname').val()=="")
{
alert("Name cannot be Blank");
}
else{
$.post('data.php',{action: "insert", name:jname, comment:jcomment},function(res){
$('#result').html(res);
}); }
});
$('#show').click(function(){
$.post('data.php',{action: "show"},function(res){
$('#result').html(res);
});
});
});
这篇关于Facebook的弹出系统与评论功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!