This blog is moved to

Thursday, June 18, 2009

jQuery Tips

Getting text box value
Chang or set label text
$(“#LabelId”).text(“Your Text”);
Set control CSS “i.e td border width”
$(“#td_id”).css('border-width', '1px');

Display DIV element with animation

Swap Items between two lists
$(“#list1-id :selected”).remove().appendTo(“#list2-id”);

Passing parameters to web services
var prm1=”value”;
var prm2=2;
type: "POST",
url: "/AjaxWebMethods.aspx/WebMethod ",
data: '{"parameter1":"' + prm1+ '”,"parameter1":"' + prm2+ '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
/*your code*/
error: function(err) { /*your code*/}
Look for data line

No comments: