How to know the Jquery library version just by viewing the codes made by other users?

Asked

Viewed 112 times

1

I have a small jquery code here, offered by a member of this site that I ended up finding, and I don’t know which version of the library I should upload and execute someone else’s code. I can’t comment on the response he gave to another user because of my reputation, which library should I add?

$(document).ready(function(){

$("#ckAll").click(function()  {  // minha chk que marcará as outras

if ($("#ckAll").prop("checked"))   // se ela estiver marcada... 

$(".chk").prop("checked", true);  // as que estiverem nessa classe ".chk" tambem serão marcadas
     else $(".chk").prop("checked", false);   // se não, elas tambem serão desmarcadas

}); 

1 answer

1


I don’t know if this is the ideal answer, but my tip will always use the most current version! Because theoretically it always corrects and improves the previous versions.

Then after you put the most current version you test to see if it works. If you run ok. If you have an error, you can refer to official documentation if something in the code is like deprecated. If you see in the Console that there is an error, you identify the error, take the method name, and query the documentation here: https://api.jquery.com/category/deprecated/

Another tip is to look at the date of the posting from where you picked up the code and check what the date version was on that list of Releases Dates https://en.wikipedia.org/wiki/JQuery

inserir a descrição da imagem aqui

  • It is quite feasible to even look at user publication date, Thanks!

  • @Elienayjunior this can eliminate much of the chances of catching the wrong version believe. Good luck there! But try testing with the younger vesion first, only take the old ones if you have any mistakes.

  • 1

    @dvd my answer falls under the category "Brazilian way" haha. It is not perfect by a long shot, but I think it helped in the case of the colleague here. Tb did not understand you take this downvote, for me is a valid answer. By the way, Blanca’s photo is much better :D []’s

Browser other questions tagged

You are not signed in. Login or sign up in order to post.