如果变量等于,则jquery ajax取消隐藏div

    <script>
$(document).ready(function(){
 var currentsize = $('option:selected', $('select#size')).val();
    $.ajax({
        type: \"post\",
        url: \"tshirt_ajax.php?checkshop=$shopid&checkproducttype=$producttype&stockcolor=\" + $('#productColor$articleid').val() + \"&currentsize=\" + currentsize,
        success: function(data){
            $('select#size').html(data);
   $('#size').coreUISelect();
   $('#quantity').coreUISelect();
  }
    });

   $('a.colorlink').click(function(e){
 e.preventDefault();
    var stockcolor = $(this).attr('id'),
        checkshop = $shopid,
        checkproducttype = $producttype;

    $.ajax({
        type: \"post\",
        url: \"tshirt_ajax.php?checkshop=\" + checkshop + \"&checkproducttype=\" + checkproducttype + \"&stockcolor=\" + stockcolor + \"&currentsize=\" + currentsize,
        beforeSend: function(){
            $('#productColor$articleid').val(stockcolor);
        },
        success: function(data){
            $('select#size').html(data);
        $('#tshirtimg').attr('src', '$http://www.ni-dieu-ni-maitre.com/images/".$productid."_' + stockcolor + '_2/t-shirt-couleur.png');
        $('#ex1 .zoomImg').attr('src', '$http://www.ni-dieu-ni-maitre.com/images/".$productid."_' + stockcolor + '_2/t-shirt-couleur.png');
   $('#size').coreUISelect('update');
        }
    });

    });

 $('select#size').change(function(){
  currentsize = $('option:selected', this).val();
 });

});
</script>

I also have the following div:

<div class='etiquettedescription_content' style='display:none;'>

On the script above, i want to add the following commands:

I'm trying to modify the script above so when "a.colorlink" is clicked, i want to unhide the div but only IF the clicked stockcolor corresponds to 1, 351, 63 OR 16

Any idea how i can do that ?

if i understand your question correctly, then try this:

$('a.colorlink').click(function(e){
 e.preventDefault();
    var stockcolor = $(this).attr('id'),
        checkshop = $shopid,
        checkproducttype = $producttype;
        if( stockcolor==="1" || stockcolor==="351" stockcolor==="63" stockcolor==="16"  ){
            $(".etiquettedescription_content").show();
        }else{
            $(".etiquettedescription_content").hide();
        }
        .....

If I misunderstand your question, sorry.

In $('a.colorlink').click event handler, add

if(stockcolor == 1 || ... other values) {
    $('.etiquettedescription_content').css('display', 'block');
}