Bienvenido, Invitado
Recordarme

TEMA:

how to load js libraries 10 meses 2 semanas antes #251752

  • Autor del tema
  • fatainformat
  • Fuera de línea
  • Fresh Breezer
  • Fresh Breezer
  • Mensajes: 4
  • Gracias recibidas: 0
Hi all,
i have to create a form with several fields, store that inputs into an url and attach it to a src image element. But i need the loading of a js library, how can i solve this problem?
   <script 
 src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
 

and after this script i have to add my onclick function
  <script type="text/javascript">
        function generateBarCode()
        {
           //inputs fileds
            var nric = $('#text').val();
            var nric1 = $('#text1').val();
            var nric2 = $('#text2').val();

//new url with input fields           
 var url = 'https://api.qrserver.com/v1/create-qr-code/?data=' +nric + ','+nric1+','+nric2+'&amp;size=50x50';                       

//new url attached to the image            
$('#barcode').attr('src', url);

        }
    </script>

In practice i have to attach the new url (after the user input datas) into the img (#barcode) at the beginning of the form. Some one can suggests some tips for solving the loading js script?

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by fatainformat.

how to load js libraries 10 meses 2 semanas antes #251753

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 7387
  • Karma: 3
  • Gracias recibidas: 529
Hi,

here is an example how to load js libraries.
Please look this:
crosstec.org/en/support/online-documenta...ked-field-input.html

Hope this helps

If you need more help, please let me know

Regards,
Tihana

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

  • Página:
  • 1
Tiempo de carga de la página: 0.039 segundos