Posts by relaxeaza • 1,363 points
35 posts
-
2
votes2
answers220
viewsQ: Regex: Open and close with the same character and allow more than one type
It is possible to get a text between two characters that are equal, with the following conditions: The opening character shall be the same as the closing character. Allow more than one character…
-
1
votes2
answers2044
views -
1
votes1
answer106
viewsA: How to start Jekyll with an already downloaded theme
In the terminal, go to the blog directory and run bundle install to install all Jekyll dependencies. If it still doesn’t work, directly install the jekyll-paginate with gem install jekyll-paginate.…
-
2
votes2
answers550
viewsA: How to do advanced searches on Github?
All research inline that you can do: user repo created language stars forks size pushed fork extension size path state comments label author mentions assignee updated fullname location followers…
-
1
votes2
answers77
viewsA: PHP comparison does not work
You got it on parole. if($aceitos > 0 AND $aceitos < 61) should be if($aceitos < 1 OR $aceitos > 60)
-
1
votes2
answers545
viewsA: How to update $Scope.items after push run?
$scope.addItem = function () { $scope.items.push({ nome: $scope.user.nome, email: $scope.user.email, soma: sum++ }); $scope.user.nome = ''; $scope.user.email = ''; }; You don’t need to pass the…
-
1
votes2
answers94
viewsA: How to delimit the area of the ". Animate()" of jQuery?
Basically you need to define in javascript the limits that the doll can move. In this case will be the width and the height. Before calling the .animate() you need to make the check if the top and…
-
11
votes1
answer1976
viewsA: Field "__v" in all documents of a collection
__v is a versionally present key in every document created through the Mongoosis. This key is incremented when there is a change in the structure of a collection that already has documents, example:…
-
7
votes1
answer1976
viewsQ: Field "__v" in all documents of a collection
All my documents in a Mongodb database have a field __v, what it means? > db.speeds.find({}).limit(2).pretty() { "_id" : ObjectId("586826f700890738a5e8cb3d"), "remoteId" : 1, "first" :…
-
5
votes2
answers226
viewsA: How to construct this regular expression?
/^(.)+(?=([\d+]\.?[\d+]|\d\w))/g ^(.)+ (?= ( [\d+]\.?[\d+] | \d\w ) ) This expression will get any text that comes before "0.0" or "0x". Explanation of the expression: ^(.)+ any text from the…
-
2
votes2
answers365
viewsA: How to leave vertical line the size of the div
To make the element .img have a height: 100% valid, is turning it into position: absolute and removing the float: left. The element .txt now you’ll need a margin-left to adapt. Upshot: .font-15,…
-
3
votes3
answers48417
viewsA: Make text have line break inside the div
A simple white-space: normal in div will solve the problem. EDIT: Within the class .autocomplete-suggestion has a white-space: nowrap which is preventing automatic line breaking. Remove it. The…
-
1
votes1
answer59
viewsA: Is it wrong to use the position attribute to position elements instead of the float?
If all content on your page is static, I see no problem using position to assemble the structure. If it is not static hardly you will be able to structure properly without float.…
-
2
votes2
answers92
viewsA: Create control flow in playlist for web player
Changes its function troca this one should work. Try adding a Jsfiddle that will help a lot. img = ['1','2','3','4'] indice = 0; function resetThumbnail () {…
-
5
votes2
answers760
viewsA: How to hide half a piece of content
https://jsfiddle.net/d8gz67nt/1/ I will leave an example to serve as a basis for you to have a notion. At the end I left some links. First we must know the structure of HTML, we will use a div with…
-
3
votes3
answers12797
viewsA: Refresh page after action
You can use JavaScript and php to reload the page. Javascript location.reload(); PHP header('Refresh:0');…
-
2
votes2
answers399
viewsA: Vue-Resource $http.get does not recognize json with [
The correct property of response is body and not data. // supondo que o retorno seja [{"Id":"50630","Operador":"","Id_cadastro":"61693"}] this.$http.get('data.json').then(function(response) {…
-
0
votes1
answer57
viewsA: Problem getting access time
Making an AJAX request at an event unload no guarantee will be completed. I’m not sure if it depends on the connection being fast enough or if the browser cancels the request. But there is a…
-
2
votes2
answers1377
viewsA: Customize input range for progress bar?
Stylizing input[range] input[type=range] { -webkit-appearance: none; /* remove estilo padrão do browser */ } /* estiliza o marcador móvel */ /* Chrome/Safari/Opera */…
-
4
votes1
answer79
viewsA: capture input text javascript value
The mistake you made was getting the value of input right in the class constructor. As the class is called right at the top of the page, this.add will always be an empty value. What you need to do…
-
5
votes3
answers24684
viewsA: How to browse an object in Javascript?
It is right to use for in with property check to avoid possible errors. Example: var obj = { "column01": "Coluna 01", "column02": "Coluna 02", "column03": "Coluna 03" }; for (var column in obj) {…
javascriptanswered relaxeaza 1,363 -
1
votes5
answers3628
viewsA: modal boostrap opens and closes alone
I added the libs that Bootstrap itself propose and put your modal and worked normally. <!DOCTYPE html> <html> <head> <script…
-
2
votes2
answers807
viewsA: Open Popover by clicking the tab and closing only by the button
Just add a .popover('show') in the creation of the popup. $(document).ready(function() { // Associa o evento do popover ao clicar no link. $('#Responsivo').popover({ //trigger: 'manual', placement:…
-
3
votes1
answer307
viewsA: Convert Excel (.xls) to (.htm)?
Phpexcel Download the class on github repository. The php class and its dependencies are in the folder Classes. Example of use Here is done the reading of that spreadsheet and generated a table in…
-
6
votes3
answers24310
viewsA: How to check if a String is empty in Javascript?
There are three ways to check this. if (pessoa.nome === "") {} or if (!pessoa.nome) {} or if (pessoa.nome.length === 0) {}…
javascriptanswered relaxeaza 1,363 -
3
votes2
answers148
viewsA: Paste a treated text where the pointer is
You’ll need to work with Selection Ranges. Here this function will insert the values from the pointer position: function insertAtCursor(myField, myValue) { //IE support if (document.selection) {…
-
1
votes1
answer53
viewsA: Ajax function being ignored
The variable retorno is still undefined when it passes by if. This is because the script does not wait for the Ajax request to finish to continue. You need to put a callback function to be called as…
-
2
votes1
answer382
viewsA: How to rotate a letter?
CSS3 Transforms do not work on inline elements, which in your case is a span. What you can do is add one display: inline-block in the element you want to rotate. I made the change here: <h1…
-
1
votes1
answer247
viewsA: convert javascript code to jquery
There’s not much to do in your code, just take the elements by #id via jQuery. var ctx1 = $("#GraficoDonut1")[0].getContext("2d"); new Chart(ctx1).Doughnut(data1, options);…
-
0
votes2
answers554
viewsA: Taking information from a select and passing an array
You need to loop the items in the select#Model, and store the data of each <option> in the array. var dados = []; $('#Model select').each(function (i, select) { dados.push({ Name:…
-
3
votes3
answers38537
viewsA: Alignment of buttons with css
To align in the center you will need to use a parent element. Place the buttons inside a div. div { width: 1000px; margin: 0 auto; } The width may be any size, but is required. Now to have line…
-
4
votes2
answers816
viewsA: how to hide and show the element by changing the css with jquery
There’s a mistake in yours if. instead of if($(this.checked)) use if(this.checked) Or maybe his intention was to use the method is jQuery: $(this).is(':checked')…
-
2
votes1
answer4048
viewsA: Populating Chart.js with AJAX request data
To render the graphics again, you just need to call the function again gerarGraficos. But how do you want it to be rendered with new data, the variables dataLine and dataBar need to be changed. You…
-
2
votes1
answer123
viewsA: Sum between the value of inputs failed in certain cases
This is a problem not only of Javascript but of computing in general. You can use the method .toFixed in its variable soma to normalize this. function calcular() { var soma =…
-
2
votes1
answer48
viewsA: nullifying function action if result is false
Every time the code is executed and the value is Nan, it will change the border to red. After the value is no longer Nan, you need to get the border back to its original state. You only need one…