Skip to content
Advertisement

Tag: jquery

jQuery does not change element text after ajax

I have the following html: And I have the following jquery: I have additional jquery that keeps the button disabled until the length of the data in the input is 4. When the length is 4, I enable the button. When running the code, as soon as the length of the data in the input box is 4, the button

JQuery Validator with custom .addMethod over Bootstrap gives problems when was-validated class is active

I’m having some troubles with Bootstrap 5 and JQuery Validator with custom class. Seems it works separately from Bootstrap. In this method for checking hex validity (optional) the .was-validated form class generates problems. Here my code It’s more complicated said than done. So go use fiddle https://jsfiddle.net/qmsjo3L7/ Insert in the second input a wrong hex, like (wekdne). You got the

Fetch latitude and longitude from google map

I have an embedded Google map in my website which has a ‘Place Autocomplete widget’ which we use to get a place ID, name etc. when searching. I also need to get the latitude and longitude of a marked place. Answer You can retrieve the lat/lng from the geometry property in the Place model you retrieve:

.each not always change values?

I have a site where I have 5 columns and I want to change their background with some random colors. I don’t get why sometimes it changes it, sometimes it doesn’t and some columns remain the same as before. I’ve put an alert to check if “colors[i]” change, and it does. So why do some columns remain the same in

Convert AJAX Jquery to Vanilla Javascript (POST) with .fetch async

I am trying to change this .ajax call from Jquery to pure Javascript. And this way I receive the JSON in my PHP: echo ‘{“enviando”:-1,”cat”:”<span class=text-primary><strong>’ . $exampleresult . ‘</strong></span>”}’; JQUERY CALL: And this is my try with Vanilla Javascript: But I get the error: SyntaxError: Unexpected end of JSON input at envSoli. And the error line: let resultado =

Advertisement