Saturday, 10 August 2013

Fllicker like title edit using java

// siddhu vydyabhushana // 23 comments
Flicker like title edit using java, jquery, jsp, is quite little bit confusing so i am interested to teach you something which i know, i hope you like it.same post you can find it in 9lessons in php













                     Download: click here
java script code:
$(function() 
{

$("h4").click(function() 
{
var titleid = $(this).attr("id");
var sid=titleid.split("title");
var id=sid[1];
var dataString = 'id='+ id ;
var parent = $(this).parent();
$(this).hide();
$("#formbox"+id).show();
return false;
});
 
$(".save").click(function() 
{
var A=$(this).parent().parent();
var X=A.attr('id');
var d=X.split("formbox");
var id=d[1];
var Z=$("#"+X+" input.content").val();
var dataString = 'id='+ id +'&title='+Z ;
$.ajax({
type: "POST",
url: "imageajax.jsp",
data: dataString,
cache: false,
success: function(data)
{
A.hide(); 
$("#title"+id).html(Z); 
$("#title"+id).show(); 
}
});
return false;
});
$(".cancel").click(function() 
{
var A=$(this).parent().parent();
var X= A.attr("id");
var d=X.split("formbox");
var id=d[1];
var parent = $(this).parent();
$("#title"+id).show();
A.hide();
return false;
}); 
});
css code:
#container
{
margin:0 auto;
width:900px;
font-family:Arial, Helvetica, sans-serif;

}
td
{
width:100px;
}
h4
{
margin:0px;
padding:0px;
}
h4:hover
{
background-color:#ffffcc;
}
.save
{
background-color:#cc0000;
color:#fff;
padding:4px;
font-size:11px;
border:solid 1px #cc0000;
text-weight:bold;
-moz-border-radius:5px;-webkit-border-radius:5px;
}
.cancel
{
background-color:#dedede;
color:#333;
padding:4px;
font-size:11px;
border:solid 1px #dedede;
-moz-border-radius:5px;-webkit-border-radius:5px;
}
database images

 
imageajax.jsp:
<%@page import="java.sql.*"%>
<%
if(request.getParameter("id")!=null)
{
int id=Integer.parseInt(request.getParameter("id"));
String title=request.getParameter("title");
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:flicker");
Statement stmt=con.createStatement();
stmt.executeQuery("update images set title='"+title+"' where id="+id+" ");
con.close();
}
catch(Exception e)
{
out.println(e);
}
}
%>
databse after update:


your likes, shares make me more happy
 

23 comments:

  1. packers and movers noida sector 12 @ http://www.noidapackers.co.in/
    packers and movers noida sector 53 @ http://www.noidapackers.co.in/
    packers and movers noida sector 51 @ http://www.noidapackers.co.in/
    packers and movers noida sector 50 @ http://www.noidapackers.co.in/
    packers and movers noida sector 49 @ http://www.noidapackers.co.in/
    packers and movers noida sector 41 @ http://www.noidapackers.co.in/
    packers and movers noida sector 39 @ http://www.noidapackers.co.in/
    packers and movers noida sector 62 @ http://www.noidapackers.co.in/
    packers and movers noida sector 61 @ http://www.noidapackers.co.in/

    ReplyDelete
  2. This is a nice tip, and however I like your articles, thanks for give sharing this to all together.
    Regards - Blot Tutorial Supporter

    ReplyDelete
  3. Thanks for sharing this post.Nice post.
    Click Here...

    ReplyDelete
  4. We are offering website service or website design for your company website......

    App Buzz

    ReplyDelete
  5. Nice list of ideas that can help to improve our website designing, when i designing website I will remember these points and make some good designing.service web design

    ReplyDelete
  6. I like this Article. Thanks for sharing the valuable information with us. Keep Posting.
    We the best five are one of the Top 5 Movers and packers in Chandigarh providing all kind of services like packing, unpacking, loading, unloading and other corporate relocation services. Hire the best five Movers and packers in Chandigarh for trouble free and damage free shifting experience.
    Packers and Movers in panchkula
    Packers and Movers in chandigarh
    Packers and Movers in mumbai
    Packers and Movers in pune
    Packers and Movers in bangalore

    ReplyDelete
  7. Thanks for sharing this amazing article. I like it very much. Keep posting
    Jai Balaji movers and packers are No. 1 movers and packers in Thane. From packing to unpacking, loading to unloading, home shifting to corporate shifting, Jai Balaji Movers and packers Thane is the one stop shop for all.
    Packers and Movers in thane
    Packers and Movers in mumbai
    Packers and Movers in navi mumbai

    ReplyDelete
  8. Thanks for sharing this amazing article. Keep posting
    Kamal Cargo packers and movers are one of the top service providers with specialization in relocation services. Understanding the needs and requirement of clients, we provide best services at very affordable cost and we prioritize our customer need and serve one by one, best in field of packers and movers.
    Packers and Movers in thane
    Packers and Movers in Mumbai
    Packers and Movers in Mulund

    ReplyDelete