Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di Nazza97
    Registrato dal
    Apr 2012
    Messaggi
    200

    Simbolo + e Post! Spazio Bianco

    Salve
    codice:
    <script type="text/javascript">
    $(document).ready(function()
    {
     
    $("#type_here").keyup(function() 
    { 
    var mess = $("#type_here").val();
    var msgbox = $("#output_fix");
    if(mess.length > 0)
    {
    $("#output_fix").html('[img][/img]');
     
    $.ajax({ 
    type: "POST", 
    url: "get.php", 
    data: "mess="+ mess, 
    success: function(msg){ 
    $("#output_fix").ajaxComplete(function(event, request){ 
     
    if(msg == 'OK')
    { 
    // if you don't want background color remove these following two lines
    $("#type_here").removeClass("red"); // remove red color
    $("#type_here").addClass("green"); // add green color
    msgbox.html(' <font color="Green"> Disponibile </font>');
    }else{ 
    // if you don't want background color remove these following two lines
    $("#type_here").removeClass("green"); // remove green color
    $("#type_here").addClass("red"); // add red  color
    msgbox.html(msg);
    } 
    });
    } 
    }); 
     
    }
    else
    {
    // if you don't want background color remove this following line
    $("#type_here").addClass("red"); // add red color
    $("#output_fix").html('<div class="g">Null</div>');
    }
    return false;
    });
    });
    </script>
    Se metto il + mi viene uno spazio bianco quando ottengo con $_POST... Perchè? e se metto il - o * funziona..
    Nazza

  2. #2
    i parametri, se stringhe, vanno encodati

    codice:
    data: "mess="+ encodeURIComponent(mess),

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.