Home / 2015 / Temmuz (page 2)

Monthly Archives: Temmuz 2015

Kontrollerin değerini almak

$("p").click(function () { var htmlstring = $(this).html(); // obtain html string from paragraph $(this).text(htmlstring); // overwrite paragraph text with new string value }); var value1 = $('input#username').val(); // textfield input value var value2 = $('input:checkbox:checked').val(); // get the value from a checked checkbox var value3 = $('input:radio[name=bar]:checked').val(); // get the ...

Read More »

Attributelarda get ve set

var alink = $("a#user").attr("href"); // obtain href attribute value $("a#user").attr("href", "http://www.google.com/"); // set the href attribute to a new value $("a#user").attr({ alt: "the classiest search engine", href: "http://www.google.com/" }); // set more than one attribute to new values

Read More »

Html Ekleme

var sometext = "here is more HTML"; $("p#text1").append(sometext); // added after $("p#text1").prepend(sometext); // added before

Read More »

AJAX Örneği

$.ajax({ type: 'POST', url: 'backend.php', data: "q="+myform.serialize(), success: function(data){ // on success use return data here }, error: function(xhr, type, exception) { // if ajax fails display error alert alert("ajax error response type "+type); } });

Read More »

Tüm resimlere width height vermek için

jQuery(function() { jQuery('img').one('load',function() { var myImg = new Image(); myImg.src = jQuery(this).attr('src'); jQuery(this).attr('width',myImg.width+'px'); jQuery(this).attr('height',myImg.height+'px'); }); });

Read More »