AJAX query Doubt about browser warning

0

hi friends I have a question as you will see work with php javascript jquery etc .. my concern is the following when I make a ajax call in the same call I add a script tag because I really need it to execute the corresponding functions once ajax strong> I returned the data , but the browser shows me a warning as you will see in the image below. I wanted to know if there is a more efficient way to include script tags in the calls here I leave an example with code

Even if I throw this warning the code works perfectly but the truth that worries me I want my code to be as clean as possible

and this is my code of the so-called ajax

//en este div se mostraran los chats
<div id="chat-here"></div>
/*Aqui el cuelpo del formulario que necesito traer*/
    <div id='next'>



     <?php 
        $selector=mysqli_query($conexion,"SELECT * FROM registro");
        while($usuarios=mysqli_fetch_array($selector)){

        $messages= mysqli_query($conexion,"SELECT * FROM mensajes WHERE de='$yo' AND 
         para='$id' AND status=0");
        $message_cuantily=mysqli_num_rows($messages); ?>

        <div id='roome' style='width:100%;  position:fixed;  height:55px;  bottom:85px; background:white; padding:3px; background:white; margin-left:-15;'>

        //nesecito traer este formulario que luego llamara otro archivo como veran
        //para que me inserte los mensajes
           <form action='insertar_mensajes.php' method='get' class='formi' 
             id='formi'>

           <div class='input-group' >
           <div class='input-group-append' >

           <input type="text" placeholder="escribe tu mensaje" id="justchat" 
        class="chatting" name="textoChat" >
           <input type='hidden' value='<?php echo$message_cuantily?>' 
             name='message_ca' id='message_ca'>
             //mediante unos input hidden enviare alguna informacion
           <input type='hidden' value='<?php echo $myfoto?>' name='fot' id='fot'>
           <input type='hidden' value='<?php echo$id?>' name='dato' id='dato'>
            <input type='hidden' value='<?php echo$yo?>' name='yo' id='yo'>

           <button type='submit' class='btn btn-outline-dark intro' id='<?php echo$usuarios["id"]?>'>Enviar</button>
           </div>
           </form>
        </div>
        <?php } ?>
        </div>


        /*en esta misma llamada ajax necesito agregar esta etiqueta de script*/
     /*si no la agrego no me funciona el formulario*/ 
        <script src="js/Clientes.js"></script>

** my ajax **

url="message.php";

      $.ajax({

        url:url,
        type:"GET",
        data:{id:id}, 
        success:function(response){

         $("#mensajes").fadeIn("fast");
         $("#message_notifications").fadeOut("fast");
         $("#shower").fadeOut("fast");
         $("#cuerpo").html(data);//aqui se muestra mi formulario

        }



         })

This my simple code I did not want to give such a long example to not sting many guys NOTE: it's not that the code does not work for me it works perfectly but the warning of the browser worries me XD would appreciate any advice and how bad is this or if you just ignore this warning

    
asked by andy gibbs 05.06.2018 в 02:19
source

0 answers