Tag: jquery

61 votes
18 answers
1.3K views
Abort Ajax requests using jQuery

Is it possible that using jQuery, I cancel/abort an Ajax request that I have not yet received the response fro

avatar
Roger
0 1 0 9
asked 07 September, 2021
65 votes
30 answers
1.8K views
Get current URL with jQuery?

I am using jQuery. How do I get the path of the current URL and assign it to a variable? Example URL: http:/

avatar
Georgie
0 1 0 9
asked 07 September, 2021
62 votes
30 answers
2.1K views
How do I format a Microsoft JSON date?

I'm taking my first crack at Ajax with jQuery. I'm getting my data onto my page, but I'm having

avatar
Clarice
0 1 0 9
asked 07 September, 2021
52 votes
14 answers
3K views
How can I select an element with multiple classes in jQuery?

I want to select all the elements that have the two classes a and b. <element class="a b"> So, only t

avatar
Virgil
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
1.3K views
$(document).ready equivalent without jQuery

I have a script that uses $(document).ready, but it doesn't use anything else from jQuery. I'd like

avatar
Freida
0 1 0 9
asked 07 September, 2021
55 votes
20 answers
2.2K views
Get the size of the screen, current web page and browser window

How can I get windowWidth, windowHeight, pageWidth, pageHeight, screenWidth, screenHeight, pageX, pageY, scree

avatar
Tana
0 1 0 9
asked 07 September, 2021
58 votes
19 answers
1.7K views
How to get the children of the $(this) selector?

I have a layout similar to this: <div id="..."><img src="..."></div> and would like to us

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1K views
How can I determine if a variable is &apos;undefined&apos; or &apos;null&apos;?

How do I determine if variable is undefined or null? My code is as follows: var EmpName = $("div#esd-names d

avatar
Hilario
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
1.5K views
Get selected text from a drop-down list (select box) using jQuery

How can I get the selected text (not the selected value) from a drop-down list in jQuery?

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
55 votes
18 answers
2.1K views
.prop() vs .attr()

So jQuery 1.6 has the new function prop(). $(selector).click(function(){ //instead of: this.getAttrib

avatar
Yolando
0 1 0 9
asked 07 September, 2021
56 votes
19 answers
2.1K views
Disable/enable an input with jQuery?

$input.disabled = true; or $input.disabled = "disabled"; Which is the standard way? And, conversely, how

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
2.5K views
Scroll to an element with jQuery

I have this input element: <input type="text" class="textfield" value="" id="subject" name="subject"> T

avatar
Corrin
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
2.3K views
Add table row in jQuery

What is the best method in jQuery to add an additional row to a table as the last row? Is this acceptable? $

avatar
User demo
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
1.5K views
How can I refresh a page with jQuery?

How can I refresh a page with jQuery?

avatar
Majorie
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.6K views
How do I detect a click outside an element?

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to

avatar
Shanita
0 1 0 9
asked 07 September, 2021
51 votes
12 answers
1.4K views
Why does my JavaScript code receive a "No &apos;Access-Control-Allow-Origin&apos; header is present on the requested resource" error, while Postman does not?

Mod note: This question is about why XMLHttpRequest/fetch/etc. on the browser are subject to the Same Access

avatar
Robyn
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
1.4K views
How can I know which radio button is selected via jQuery?

I have two radio buttons and want to post the value of the selected one. How can I get the value with jQuery?

avatar
Luis
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
1.6K views
Is there an "exists" function for jQuery?

How can I check the existence of an element in jQuery? The current code that I have is this: if ($(selector)

avatar
Deedee
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
2.6K views
How can I upload files asynchronously with jQuery?

I would like to upload a file asynchronously with jQuery. $(document).ready(function () { $("#uploa

avatar
Dario
0 1 0 9
asked 07 September, 2021
51 votes
14 answers
2.7K views
event.preventDefault() vs. return false

When I want to prevent other event handlers from executing after a certain event is fired, I can use one of tw

avatar
Vi
0 1 0 9
asked 07 September, 2021