Most voted "jquery" questions
jQuery is a Javascript library focused primarily on DOM handling, event management and Ajax, seeking to free developers from directly dealing with a number of browser compatibility issues.
Learn more…11,371 questions
Sort by count of
-
123
votes9
answers13997
viewsHow to create a website without reloading every click on a link?
I’m looking to develop a site that runs all in the same file, but I’m not sure how to look for study material for this. Thus: Normal site->I’m on the Index.php page. When I click on the…
-
101
votes6
answers42802
viewsWhat is the difference between . on("click", Function() {}) and . click(Function() {})?
I usually use it because I learned it was the more correct, the assignment of events as follows: $('seletor').on('click', function(){}); However, I see many developers using the following syntax:…
jqueryasked 10 years, 9 months ago Felipe Avelar 9,507 -
83
votes4
answers42074
viewsWhat are the main differences between jQuery and Angularjs?
I am noticing the adhesion of Angularjs and the abandonment of jQuery by some developers, however I do not know the advantages of Angularjs because I have never worked with this framework. Since…
-
67
votes3
answers5939
viewsWhat are the techniques for making scroll-based animations?
I’m interested in creating websites with scroll-driven animation (ex.: Kano), where content is animated and replaced as the page is scrolled. What are the techniques to facilitate such programming?…
-
58
votes7
answers115219
viewsMask for CPF and CNPJ in the same field
Hello, I looked for this doubt in the questions, but I could not find it. Well, I would like to make a field have the Cpf and cnpj masks depending on the number of characters typed. Here it doesn’t…
-
54
votes2
answers126902
viewsWhat is the difference between $(Document). ready() and window.onload?
There is a difference between $(document).ready() e window.onload apart from one being Javascript and the other being jQuery? I see both events are triggered as soon as the GIFT (Document Object…
-
51
votes1
answer24387
viewsWhat is the difference in the use of Return false, Event.stopPropagation() and Event.preventDefault()?
Num Handler jQuery event, one can use return false, event.stopPropagation() and event.preventDefault() (or combinations thereof) to "cancel the action" of the event. I know there’s a difference in…
-
51
votes3
answers3927
viewsWhat is the difference between $(this) and $this and this?
I’ve always used the $(this) independent of the situation and always worked. Rarely have I had to use one of the others and on those occasions I did it for someone’s guidance and not for knowing…
-
45
votes5
answers76380
viewsHow to pin a "horizontal menu" to the top of the window when scrolling the page?
I have a layout with a horizontal navigation bar at the top of the site, it is with margin-top:100px, when scrolling the page the menu should be fixed at the top of the window but with margin-top:0.…
-
42
votes14
answers126839
viewsPhone Mask Using jQuery Mask Plugin
I need to change the "-" position on the mask. <label for="telefone" >Telefone</label> <input style="width:25%; margin-right:25% " type="tel" name="telefone" id="telefone"…
-
39
votes8
answers48548
viewsHow to pass parameters in function calls by reference in Javascript?
I recently asked the question Why should we use Anonymous functions with jQuery instead of the function directly? and along with the accepted answer came a second question: How to pass arguments to…
-
37
votes9
answers34793
viewsInput type="password" with password display eye
I need to put a <input type="password"> with that eye of the reveal password, but it has to work as follows: User clicks on the eye and when dropping hides the characters again. Follow an…
-
32
votes5
answers5370
viewsHow to apply ! CSS import via jQuery?
I’m trying to apply style to my element and define its importance in this way: $('div').css('height','50px!important'); But it doesn’t work, which would be the right way?…
-
32
votes2
answers55629
viewsCORS - No 'Access-Control-Allow-Origin' header is present on the requested Resource
Good evening, I’m trying to access a server from my local machine and I’m getting this answer: No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin 'http://localhost'…
-
31
votes5
answers14927
viewsHow to not allow a character to be typed in the textbox, with Javascript/jQuery?
I have a Textbox: <input type="text" name="indice" class="number"> I wanted that when a person typed a comma in this Textbox it would be blocked and not appear in the Textbox. How to do it the…
-
29
votes3
answers4056
viewsHow to get the value of the current percentage of an upload?
I’m working with PHP, but I imagine it can be done only with javascript/jQuery. When I upload the browser shows the percentage in the status bar. I would like to take this value and create from it a…
-
29
votes8
answers95476
viewsHow to check with jQuery if there is a checkbox checked?
I would like to know which Checkbox is checked with Jquery. To catch all the checks I made the following code var checado=false; $(obj).find("input[name='analisar']").each(function(){…
-
29
votes3
answers10218
viewsHow to create a real-time notification system similar to Stack Overflow?
I am developing a Help Desk system, and would like some ideas on how to create a notification system similar to Stack Overflow itself, whenever some new support is registered. I intend to use PHP,…
-
27
votes4
answers141141
viewsHow to redirect the user to another Javascript/jQuery page?
I would like to know what methods of redirecting exist in Javascript, and also using jQuery, and if possible, I would like to know all of them.
-
27
votes4
answers9073
viewsWhat is the difference between using . js and .min.js files?
When should I use a Javascript or jQuery file, with file min and jspure, like: <script src="~/Scripts/jquery-1.10.2.min.js"></script> <script…
-
27
votes4
answers17158
viewsInclude another HTML file in an HTML file
Setting: I’m putting together a layout, which will be used by third parties and I don’t know what language will be used. I have two Ivs, one will be the left menu and the other the content. They are…
-
27
votes1
answer455
viewsWhat does the "+" sign in front of the function mean in Javascript?
Researching a little about form validation on Bootstrap, found the bootstrap-Validator, in which exactly in the file Validator.js, as you can see, it has the notation +funcion. Observe the code…
-
26
votes2
answers5355
viewsGet colors from the image
There is a possibility (with plugins or not) to catch the [main] colors or the predominant colors, similar to Adobe Kuler, image? Example I have this image: And I wanted to take her main colors,…
-
26
votes2
answers3291
viewsCrop image with Javascript
I need to upload a photo and then put it in a modal for the user to make a proportional cutout 4/3 a short web search found this jQuery plugin jCrop. He seems to provide me with the coordinates to…
-
25
votes2
answers558
viewsWhat is the difference between $(this) and $(Event.target)?
Well, a question arose while I was dealing with jQuery and the code worked perfectly in Chrome using the event $(event.target), already in Firefox only worked with $(this), then arose this doubt.…
-
23
votes2
answers29551
viewsSimple paging in jQuery/Javascript
I’m looking for a simple pagination, no CSS styles, nothing like that. Only with the buttons below to change page and with the elements on top. I’m asking because the examples I find are a little…
-
23
votes6
answers15200
viewsWhat is and how does Bootstrap work?
I did some research, but most of the articles I found are based on the assumption that the reader already has some familiarity with frameworks (which is not my case), that I still have only a vague…
-
23
votes2
answers7627
viewsWhat is the difference between Javascript and jQuery?
Think about the Jquery as a Framework JavaScript in order to optimize writing, the Ajax is a good example. In addition to easier writing, there is a difference between the two? What are the…
-
22
votes3
answers742
viewsHow to improve the performance of static files on a website?
My site has 10 sheets of styles (CSS) and 15 scripts (Javascript / jQuery), outside the images, this influences a lot in loading. In your opinion, what is the best way to make the site…
-
21
votes6
answers18042
viewsHow to make a Custom Scrollbar?
How to modify a scrollbar div, to appear as in the image example below (Hangouts), instead of the standard operating system scrollbar?…
-
21
votes2
answers14288
viewsHow to disable a text field for editing using jQuery/Javascript?
Let’s say I have a form with fields 1 to 7. Something like: field-1 field-2 field-3 field-4 field-5 field-6 field-7 All these fields are in one form. With Laravel, sometimes I experienced situations…
-
21
votes4
answers7389
viewsHow to make Ajax requests, with Jquery, on different domains?
It is possible to request a POST type to a url that is not part of the domain of our application? $.ajax({ type: "POST", url: "http://www.dominioexterno.com.br/acao/", data: { var1:…
-
21
votes2
answers1671
viewsIs it possible to add an overflow behavior with scroll only in tbody of a table?
It is possible to add a behavior of overflow with scroll only in the tbody of a table and still not have to set fixed sizes in pixels, without having to separate the column header with the body, as…
-
21
votes2
answers6309
viewsHow to remove a CSS attribute with jQuery?
In jQuery, it is possible to add an attribute to an element through the function attr. You can also remove an attribute through the function removeAttr. And when I define an attribute of css through…
jqueryasked 8 years, 10 months ago Wallace Maxters 102,340 -
21
votes2
answers17718
viewsWhat to use in Ajax, Success or done?
Sometimes I see them using success, sometimes I see .done, to process the response obtained in the request. Which one should I use? Is there any difference between the two? Which? The same thing for…
-
20
votes3
answers4043
viewsHow to add a CSS class to images that didn’t load?
I have an HTML page with numerous images presented as follows: <img alt="img1" width="50" height="120" src="my_image.jpg" /> <img alt="img2" width="50" height="120" src="another_image.jpg"…
-
20
votes2
answers523
viewsWhy should we use Anonymous functions with jQuery instead of the function directly?
I have a question, some methods of jQuery expect a function as parameter, but to work they must receive an Inner Function as parameter instead of a function directly, as in the example below:…
-
20
votes6
answers14943
viewsJS Mask for Hours Validation
I’m using in a project the jQuery Masked Input. I made a mask like this: <script> $(document).ready(function () { $("#QuantidadeHoras").mask("99:99"); }); </script> The <input>…
javascript jquery jquery-masked-input jquery-mask-pluginasked 9 years, 5 months ago Leonel Sanches da Silva 88,623 -
20
votes4
answers55577
viewsHow to validate client-side CPF with script?
I’m working with a CPF validation on my controller, but I need to validate when the customer leaves the input of the CPF and then return a message warning when the CPF is incorrect, through a alert…
-
20
votes3
answers20650
viewsWhen to use Success: Function() and . done(Function()) in asynchronous requests?
Simply put, I can write an asynchronous request like: $.ajax({ url: url, dataType: 'json', type: 'GET', success: function (_user){ alert (_user) } }); that alerts me to the return _user. Likewise, I…
-
19
votes4
answers10808
viewsIs it possible to create a desktop application using only PHP, HTML, CSS and jQuery?
Although I know that PHP is a language for the web, I would like to know one thing. It is possible in any situation to create an application, system or application with only PHP+HTML+CSS+jQuery that…
-
19
votes3
answers910
viewsHow to use $.on in pure Javascript: "$(...). on(event, selector, function)"?
It is as follows, in jQuery we have the on, any element <a> with class test and without the class foo will trigger the function when clicked, even if you create the element later the event is…
-
18
votes7
answers44529
viewsHow to get only the numbers of a string in Javascript?
I wonder if there are functions that return only the numeric values of a string, if there is not, what is the simplest and efficient way to implement? Example: apenasNumeros("5tr1ng"); Upshot: 51…
-
18
votes4
answers7395
viewsWhat’s different from jQuery’s find and filter?
I remembered that there is a function in jQuery called filter. I already know the find, but I want to know if there’s any difference between them or if they’re the same thing.…
-
18
votes3
answers4829
viewsclick a play button on the Youtube iframe
I have a iframe of Youtube, and a div above it, I want when the user clicks on that div He plays the video. My HTML: <div class="p-relative"> <div class="botaoMaior"> <div…
-
18
votes3
answers3547
viewsMeaning of parameters in an AJAX request
When making a request using $.ajax, What is the meaning of processData: false, contentType: false and async: false, what are these fields for? There is difference in using type: "post" or type:…
-
18
votes2
answers4788
viewsIs it possible to use masks on mobile devices satisfactorily?
So after a true pilgrimage that yielded about 10 questions, I discovered that the masks I was wearing didn’t work properly on mobile devices. The main ones are (were?): Maskmoney inputMask What…
-
17
votes8
answers45427
viewsHow to disable the scroll of a web page?
I’ve been trying to disable one-page scrolling. All I have found are type solutions: #container{ overflow: hidden; } But that’s just occult scroll bar. How I would disable scrolling, even with it…
-
17
votes3
answers72012
viewsGlobal variable in Javascript
How to make a global variable in Javascript? I need the variable that was declared in one function to work in another function. Example: Jsfiddle $("#div3").click(function() { var fill = "a"; });…
-
16
votes5
answers21918
viewsHow to replace the <img src> of a small image with a large image?
Information: I’m trying to make a simple photo gallery. I want to show the large-sized image in the center of the screen. (Clicar em 0.jpg e mostrar em uma outra div 0Large.jpg) Problem: With the…