dimanche 19 juin 2016

What is the correct the first or the second?


What is the correct the first or the second ? Both are working, but what is the correct one ? Is there a better way ?

$(function() {$.getJSON('./index_logg2.php', null, pro1);});
function pro1(data) {$.each(data.crop, function() {port=data.crop[0].id_user; port1=data.crop});
if (port1[0]) {$('#port_emp').remove();
   $('#my_user1').html('<a href=rock.php?user='+ port +'><img src="j3nUh9_oiN_3ks/user_pics'+ port +'/ thumb_ '+ port1[0].pic_name +'" title="View profile" ></a>').fadeIn(700);
   $('#del_user').html('<img src="images/delconv.png" title=Delete >'); }}

OR

$(function() {$.getJSON('./index_logg2.php', null, pro1);});
function pro1(data) {$.each(data.crop, function() {port=data.crop[0].id_user; port1=data.crop;
if (port1[0]) {$('#port_emp').remove();
   $('#my_user1').html('<a href=rock.php?user='+ port +'><img src="j3nUh9_oiN_3ks/user_pics'+ port +'/ thumb_ '+ port1[0].pic_name +'" title="View profile" ></a>').fadeIn(700);
   $('#del_user').html('<img src="images/delconv.png" title=Delete >'); })}}

Aucun commentaire:

Enregistrer un commentaire