Questions tagged as 'javascript'

2
answers

Checking if value exists in an array via search field

In pure javascript I can use indexOf() , something like this: var chaves = ['wmv','3gp','mp4','mp3','avi']; if(chaves.indexOf("avi") != -1) { alert("Ok!"); } But when it comes to a search field I'm trying this way: <html...
asked by 26.12.2016 / 20:29
0
answers

On which page put the JS script

I have a script to increase the amount of each product in the cart via javascript, but I do not know which page to put it in. <script> document.getElementById("diminuir").onclick = function(){myFunc1()}; document.getElem...
asked by 12.06.2018 / 13:40
1
answer

Nodemon loads directory index but does not open index

I have a problem using Nodemon, whenever I start or restart the server for it, instead of printing something on the console or loading a page, it is only in the directory index. It takes several minutes for it to finally respond and load the pag...
asked by 12.06.2018 / 00:25
0
answers

Array sent via Json to Javascript gets null in it

I have an application in which, a Javascript I have a function that performs an Ajax call to the .php file to handle. The .php handles the SearchContact (p) function like this: it does a SELECT on the MySql database (managed via XAMPP and phpM...
asked by 03.06.2018 / 21:30
1
answer

How to change the color of the scroll bar by JQuery

I want to change the color of the scroll bar only when the user scrolls the screen. I tried the code below but it did not work. How do I? $('body').scroll(function(){ setTimeout(function(){ $("body::-webkit-scrollbar").css("backgro...
asked by 04.06.2018 / 04:40
1
answer

How to add limit value along with jquery mask?

I'm using the mask plugin for this link: link I use the following jquery to do the mask: $('.decimal').mask('000,0', {reverse: true}); However I need the maximum value to be 100.0. I've tried putting $('.decimal').mask('100,0', {reve...
asked by 04.06.2018 / 02:19
0
answers

How to make a scoreboard in PHP or JS?

I saw many similar questions but no one answered me, I would not like to use Ajax because as it is an exercise, the teacher requested only JS, HTML and PHP. I did a quiz mini game, it's working fine but I could not do the score. I started cre...
asked by 02.06.2018 / 02:14
2
answers

Confirm Aspect Ratio of an image to trigger function

I have an image upload system in Php and when the images are posted, they create thumbnails. Today, these thumbnails when clicked call a jquery function to display it in a modal. I need to confirm if this image has the ratio of 2 to 1 (for ex...
asked by 02.06.2018 / 01:43
1
answer

Text is selected when opening notification

Follow the code below: $("#click_notifications").click(function () { if ($('li.nav-item.dropdown.dropdown-notifications').hasClass('open')) { $('li.nav-item.dropdown.dropdown-notifications').removeClas...
asked by 02.06.2018 / 00:22
1
answer

How to create a search filter for html table?

Good afternoon, I'm new to the area and I have one small question: how do I create an approximate search in a table with pagination? The search I was using did not filter the data on the other page, just the one on the current page. I need a cod...
asked by 11.06.2018 / 22:19