jquery

jquery

jquery – Cross domain Ajax POST

Question: Good afternoon. Trying to pass plain text from min.example.com to api.example.com var data = $(“form”).serialize() $.ajax({ url: ‘http://api.example.com/v1/’ + dept, type: ‘POST’, crossDomain: true, success: function(response){ alert(‘ajax complide’); alert(response); }, error: function (responseData, textStatus, errorThrown) { console.log(‘POST failed.’); } }); Getting -> [HTTP/1.0 403 FORBIDDEN 1036ms] Response header for …

jquery – Cross domain Ajax POST Read More »

jquery – js date format

Question: I have an example code: $(“#curday”).click(function () { var newdate; date = new Date(); newdate = date.getDate() + ‘.’ + date.getMonth() + ‘.’ + date.getFullYear(); $(“#datepicker_down”).val(newdate); }); But I have problems with him. For a month, the output starts from zero, that is, I now have the 7th month, …

jquery – js date format Read More »

jquery – Change part of a label's text

Question: I have the following label created by a plugin <label> Buscar: <input type=”search” class=”form-control input-sm” placeholder=”” aria-controls=”Pedidos”> </label> What I want to do is just change the "Search" to something X. I tried as follows but without success var Label = $(‘#Pedidos_filter’).find(‘label’).html(); $(‘#Pedidos_filter’).find(‘label’).html(Label.replace(‘Buscar’,’x’)); How could it be proceeding? Answer: …

jquery – Change part of a label's text Read More »

jquery – Is there any difference between an event with passing parameters and one without passing?

Question: Considering: jQuery $(“#seletor1”).on(“click”, function(){ $(“#seletor2”).trigger(“click”, {dados: “informação”}); }); $(“#seletor2”).on(“click”, function(){ //faça coisas }); $(“#seletor2”).on(“click”, function(evento, dados){ //faça coisas }); Which one will he trigger? Answer: Both will be triggered . The passing of parameters is determined by who emits the event, not by their naming in the listeners. So …

jquery – Is there any difference between an event with passing parameters and one without passing? Read More »

How to get element above Jquery?

Question: I have the following elements: <p class=”id-task”>5</p> <p class=”status-change”> <i id=”test-task” class=”fa fa-flask fa-lg” aria-hidden=”true”></i> </p> I'm trying to get the number 5 from <p class="id-task">5</p> with the following Jquery code: $(‘#test-task’).on(‘click’, function(){ var father = $(this).parent().siblings(); var idTask = $(father).text(); alert(idTask); }); I changed the code, because the …

How to get element above Jquery? Read More »

jquery – How to make all items in a menu the same size regardless of quantity?

Question: I want to make a menu that always leaves the items with proportional sizes, occupying the entire available width and adapting. .top-menu ul { width: 100%; } .top-menu ul li { display: inline; list-style: none; } .top-menu ul li a { display: inline-block; } <div class=”top-menu full”> <ul> <li><a>Home</a></li> …

jquery – How to make all items in a menu the same size regardless of quantity? Read More »

How to include different versions of jQuery on a page?

Question: Moreover, it is desirable not to use jQuery.noConflict(true). later you need to connect other pages with scripts, and not write scripts directly on this page, i.e. <script src=’jquery-10′></script> <script src=’jquery-4′></script> <script src=’jquery-plagin-1′></script> //тут нужно чтобы работал jquery-10 <script src=’jquery-plagin-2′></script> //a тут нужно чтобы работал jquery-4 <script> // + у …

How to include different versions of jQuery on a page? Read More »

Scroll to Top
AllEscort