Saturday, 10 August 2013

Fllicker like title edit using java

// siddhu vydyabhushana // 29 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
 

29 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
  9. Jai Balaji Packers and Movers are the best packers and movers in Thane. For services like packing and moving, warehousing services, loading and unloading and car carrier services choose Jai Balaji packers and movers Thane.

    ReplyDelete
  10. Thanks for sharing this amazing article. Keep posting
    Packing and moving is a hectic task to do however Kamal Cargo Movers and packers in Thane make it simple for you. Kamal Cargo packers and movers are one of the best specialist co-ops with specialization in relocation services.

    ReplyDelete
  11. Tivragati Packers & Movers, a moving company working on the national level providing packing and shifting services for short as well as long distances.The best part about us that we available even on a very short notice.We are officially certified and insured Packers and movers in Ahmedabad.Packing and moving services offered by us are quite economical to the common man's Pocket. http://www.tivragatipackers.com/

    ReplyDelete
  12. A wanderer journaling her travel stories all while journeying and eating her way through the world with her one and only. Aditi is a Dubai based Indian travel blogger whose work and life hasn’t stopped her from aiming to check the entire world off her bucket list. Her travel stories are based around experiencing the culture of a place while highlighting their food and as much as possible jet-setting off to off-beat and usual destinations around the globe with her globetrotter husband . https://bohemianontherun.com

    ReplyDelete
  13. Wonderful article. Thanks for sharing. Keep posting
    Are you planning for the birthday photography for your kid in Delhi, NCR and Gurgaon? My Baby 247 has a professional photographer that create cherished memories photo for you. For more information Visit Us!
    http://www.mybaby247.com/” rel=”nofollow”>birthday-photo-shoot-mybaby247
    http://www.mybaby247.com/” rel=”nofollow”>new-born-photography-mybaby247
    http://www.mybaby247.com/” rel=”nofollow”>toddlers-photoshoot-new-delhi-gurgaon-noida-faridabad

    ReplyDelete

  14. The best five packers and movers Chandigarh you will get different movers and packers under which you can choose different options according to your budget and choice.
    The options we offers to add on tasks in the process are- cost estimation of movers in Chandigarh, relocation surveys, transporting , packing and unpacking entire things , loading and unloading.
    http://www.thebest5.in

    ReplyDelete