Posts by Steve Angello • 460 points
16 posts
-
0
votes1
answer272
viewsQ: Return fetch js result on a global variable
Hi, sorry about the layman’s question. Basically I want to use the fetch return and put in a variable, I can use it in other functions to make 1 request only, today I’m using const xhr =…
-
4
votes2
answers318
viewsQ: Sum values from different JSON indices
I have an API that a chunk of it returns the following array, and for each index has an object slas that brings all carriers: [ { "itemIndex": 0, "selectedSla": "Expressa",…
-
2
votes1
answer2635
viewsQ: Check if a value is inside an array
would like to do the following: User inserts their zip code and a field input and the value that he entered within this field wanted to compare whether it is in the CEP range (01000 to 19999) of the…
-
1
votes2
answers149
viewsQ: Get multiple field values
How do I in each of a form containing input and select. The post of this form is in json with ajax. My script today takes the values of 2 input thus: var name = $('#news-nome').val(), email =…
-
0
votes3
answers1764
viewsQ: Compare two numbers and pick the biggest
Hello guys I’m creating this script to check the largest number and apply it as discount, but I’m having trouble identifying the largest number and do the calculation. Doubt is how to take the…
-
5
votes3
answers7717
viewsA: Open and Close div using the same Javascript button
Already tried to use slideToggle? $('#hamburger').on('click', function() { $('#menu').slideToggle('slow'); }); $('.menu-link').each(function() { $(this).on('click', function() {…
-
3
votes1
answer2141
viewsQ: Using a function variable in another function
I have a variable that has the resulting value of a function, I need to use that same value in another function. Ex: el1.on('change', function'){ //função pra trazer o valor que quero var IdResult1…
-
1
votes3
answers5353
viewsQ: Pick up input value whenever changed
I have an element: <input id="quantity" name="quantity" min="1" max="3" type="number"> where I store its value in a variable: var qty = $('#quantity').val(); by default the value is 1. I wish…
-
4
votes3
answers933
viewsQ: Script swap image every Reload
I have 5 banners on the home, and would like each home shipment to display one of the banners. Ex: I stopped the site and displays the banner 1, navigated some page and returned to home displays the…
-
4
votes1
answer335
viewsQ: Check for visible items within a div
How to check if there is any visible element or vice versa within a <div>? I can manage with jQuery and tried using el.is(':visible') but I couldn’t because I need to check if everyone inside…
-
5
votes2
answers1625
viewsQ: Serriled source Firefox
How to resolve this issue in Firefox regarding fonts ? Unfortunately in Chrome it gets smooth and in Firefox serrated.…
-
1
votes1
answer183
viewsQ: Match fractional number javascript
I have a script and in one of the lines: return $flag.text().match(/[0-9 ]+(?=\%)/i); reads the numbers of a tag p. Ex: <p>Desconto 15%</p> In case he will read the number 15. As far as…
-
0
votes1
answer828
viewsQ: Script for discount calculation
Has a plugin of the agency created. It works like this, it’s set to work with the word boleto and discount, if you have these names in the class of div it takes the value in % it applies a display…
-
2
votes2
answers1301
viewsQ: CSS condition with jQuery, e.g.: if div1 is visible the div2 will also be
I don’t know much Js/jQuery, but I need the following <div> hide when another <div> is hidden too. Ex: When the buy button is hidden a <div> with the discounts hide also and…
-
1
votes0
answers42
viewsQ: Option ex: select state | select city
I’d like to do the following: I have 3 Options, and as each one was selected it would bring the result the next option. Ex: Option 1 Select state | Option 2 Select city So when selected the state…
-
2
votes1
answer147
viewsQ: How to search with . serialize()
I have this Search/Serialize Jsfiddle, only I didn’t want him to take the name of select, only the value of option and search. It can "ignore" the name and use only the value ? Here’s the code: var…