Questions tagged as 'jquery'

4
answers

How to check if the first four characters of a string match 'www.'?

What is the best way to verify this? More simply and with better performance. I could only imagine doing so: var string = "www.google.com"; if(string[0] == "w" && string[1] == "w" && string[2] == "w" && string[3] ==...
asked by 09.01.2015 / 14:47
2
answers

How to print only the first 5 characters?

I need to display up to 5 characters of the contents of each table cell at a specific resolution. I do not know if there is any Pseudo Elemento that does what I need, something like: Example: @media (max-width: 548px) { p:only-fi...
asked by 18.01.2017 / 12:35
4
answers

Reset in input fields after submit with Jquery

By sending the input field values through JQuery to a PHP page I can do the action without refreshing the main page, but I can not make the input fields "empty" again?!? How do I then apply the "reset" after submission? HTML: <div id='...
asked by 04.07.2014 / 16:44
3
answers

Dynamic Javascript property name

I have the following code: var nomePropriedade = "Propriedade1"; var meuObjeto = { "nome" : "valor" } I would like the property name of meuObjeto to receive the value of the nomePropriedade variable. Home So when I t...
asked by 26.08.2015 / 16:27
4
answers

Color Loop in Text

I have the following structure in HTML: <font class="a">J</font> <font class="b">o</font> <font class="c">ã</font> <font class="d">o</font> <font class="e">P</font> <font class="f"...
asked by 06.03.2014 / 14:48
1
answer

upload without refresh with FormData, jquery

I need to update my script and I want to adapt my upload forms to be upados without the need to refresh. I did not use the script for third-party scripts so I searched and found this function of jQuery FormData . I did not rea...
asked by 09.12.2014 / 18:03
3
answers

What is the best way to load JS?

I was facing problems with loading JS, especially IE8, and I had this doubt. I researched a lot, I ended up improving some things. Currently, I load all JS files at the bottom of the page, before the body tag. <body> ......
asked by 10.04.2014 / 20:39
2
answers

Navigation scroll in Bullets

I'm developing a one page scroll site and wanted every bullets I clicked to be active for the page I'm on. This is the example I'm doing the scroll script did not put in yet but wanted to leave the effect of clicking the bullets ready. <n...
asked by 18.02.2014 / 14:46
1
answer

jQuery does not use the HTML5 dataset on date?

When modifying a certain initial value of data of jQuery, I noticed that the value of dataset is not modified. Then I wrote the following test: HTML: <div data-value="initial value" id="div-test-1"></div> <di...
asked by 11.02.2015 / 18:38