Posts by alan • 1,908 points
95 posts
-
4
votes1
answer4444
viewsA: Connection with Webservice SOAP WSDL
I managed to solve the problem by following the tutorial Calling a SOAP Webservice with PHP Stayed like this: $client = new SoapClient('http://www.roveri.inf.br/ws/cnpj.php?wsdl'); $function =…
-
1
votes1
answer4444
viewsQ: Connection with Webservice SOAP WSDL
I am trying to get an xml from a Webservice Soap wsdl. With the code below I can get a get on your methods. $client = new SoapClient('http://www.roveri.inf.br/ws/cnpj.php?wsdl'); $result =…
-
5
votes4
answers9132
viewsQ: How to change the color of a select when selecting an option
I have a select and I’m trying to change the color of it by selecting an option (for example I’m changing the color to red). Using some attributes like hover, focus, active and checked i can even do…
-
3
votes1
answer640
viewsQ: Can "<a>" be used without "href"?
Is there a restriction or problem in using the tag a without the attribute href? Example: <a>teste</a>.
-
7
votes1
answer816
viewsQ: Navigation via HTML or Javascript
I’ve been working a lot with javascript and it makes me use it for almost everything. But I’m having a question. Is there any problem of semantics, indexing or search results of my page when I use:…
-
1
votes2
answers181
viewsQ: Images in html or via css
Is there any advantage in loading an image via css with: background: url ('imagem.jpg'); instead of using it normally as: <img src="imagem.jpg">?
-
3
votes1
answer65
viewsQ: How Abstract States works at the angular
I’m working on an APP and I’m still getting to know the features of angular. I have a route file and I was suggested to add the parameter abstract: true to prevent browsing by url. However I have…
-
9
votes4
answers1246
viewsQ: Identify if all characters are equal
I have the following code that works perfectly. In it I possess a string and check whether all of its characters are equal or not: var numbers = '1111121111', firstNumber = numbers.substr(0,1),…
-
0
votes3
answers150
viewsA: Value loses content as soon as it exits ajax
Check the jQuery version you are using before using success or error. Deprecation warning: A jqXHR.Success(), jqXHR.error() jqXHR.complete()return calls are removed from jQuery 3.0. You can use…
-
1
votes1
answer641
viewsA: Birth date validation with jQuery
Edited! You can use the plugin’s own functions to do this or whatever else you want. See the simplified example: // jQuery Mask Plugin v1.14.3 // github.com/igorescobar/jQuery-Mask-Plugin var…
-
13
votes3
answers4398
viewsQ: Difference between Promise and callback
I would like to understand a little better the advantages of using Promise! today I use callback function. Ex: function a(callback) { $.ajax({ ... }) .done(function(data){ callback(data) })…
-
1
votes2
answers229
viewsQ: What does the PHP "new" actually do when instantiating a class?
I have a class called Setup with some static methods. But I’m having trouble understanding something that happens. I use the class methods as follows: Setup::$getMetodoX so far so good. However to…
-
1
votes0
answers43
viewsQ: When to use static methods?
I am working on a project and as a base I am using another for reference. However, in this other project almost all methods are declared as static. This is good practice? What are the advantages or…
-
2
votes1
answer1714
viewsQ: How Promises works in Angularjs
I’m having a little trouble understanding the workings of Promises of Angularjs. I have the following code: function validateUser(name, pw) { var status = ''; var data = {login: name, senha: pw,…
-
-2
votes2
answers1671
viewsQ: Validate input type="number" >= 1 with Angular
I am trying to do a validation so that the value of my input type="number" is >= 1. But I have tried several things and none of them worked. I am now trying to use ng-Pattern. But there is a…
-
3
votes1
answer51
viewsA: Is it possible to grab all the variables of a form at once to send to an email or do I need to declare one at a time?
You can use a foreach: foreach ($_GET as $key => $value) { echo $key . ' - ' . $value . '<br>'; }
-
11
votes2
answers10914
viewsQ: Data type for latitude and longitude
I am working on a new project where I will need to save the coordinates (latitude and longitude) of an address in the database. There is an ideal data type for this? I searched and saw some decimal…
-
3
votes1
answer328
viewsA: Request to API using Angularjs
In the end I discovered the problems! :) The problem is I’m using the ngMockE2E to process requests locally (for access control). angular.module('starter', ['ionic', 'ngMockE2E']) Therefore, my API…
-
1
votes1
answer328
viewsQ: Request to API using Angularjs
I am still novice in development using Angularjs and am having problems accessing an API: .controller('RegulamentoCtrl', function($scope, $state, $http, $ionicPopup, AuthService) {…
-
4
votes1
answer568
viewsQ: How to set up an app to launch in Google play and Apple Store
I’m developing an app using Ionic/Cordova and I came up with some doubts, are they: Must do some kind of specific configuration in my file Package.Json to have no future problems when generating a…
-
2
votes2
answers507
viewsA: Help in select to create new input text
From what I can gather from your explanation, you want to do something like this, right? var count = 1; $(document).on('change', '#opcao', function(){ $('#valor'+count).val(this.value); });…
javascriptanswered alan 1,908 -
0
votes1
answer242
viewsQ: Transpiling ES6 to ES5 using Babel
I have a package.json file set up to take all js files from a directory and join them into a new file, transpiling to ES5. However, it is only creating a new file and unifying all js files from the…
-
2
votes1
answer1697
viewsA: PHP calculates distance between cities
Replace Zip Codes with city names in parameters $origem and $destino and use the str_replace to replace spaces by %20. Behold: <?php $i = 0; $arr = array('rio de janeiro','belo horizonte');…
-
0
votes2
answers125
viewsA: formatting a string with str_pad
Uses strlen to take the size and substr to determine the start and end of the string <?php function mb_str_pad($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT, $encoding =…
-
0
votes2
answers1709
viewsQ: How to get the phone number in Ionic using Cordova or phonegap
I’m developing an app and I need to get the phone number. I did a lot of research online, and I couldn’t find much. One of the examples I found was this: Cordova-plugin-yes but I couldn’t get him to…
-
3
votes1
answer2466
viewsQ: Create . bat file to open Node.js terminal and run one or more commands
I would like to create a file . bat to automate a process I have to perform every day. Whenever I start working, I open the nodejs terminal, access my project directory (in my case I use Babel) and…
-
9
votes2
answers87
views -
6
votes3
answers197
viewsA: Account with PHP in the order it is in the string
You can do it: $string = '(10*10)+(30-5)/2'; eval( '$result = (' . $string. ');' ); echo $result; Obs: As you must know the division comes before the sum, then the result will be: 112.5 If you want…
-
0
votes1
answer2163
viewsA: Bootstrap <div> overlay
To do this, simply add a position: relative; to your div and then add a z-index: 1; to the one you want to override and z-index: 0; to the others. Behold: #header { height: 200px; background-color:…
-
2
votes1
answer496
views -
1
votes4
answers12823
viewsA: How to make a countdown with javascript?
I made some changes to your code. Have a look: Obs: To test the code. save it and test it on your local server. Otherwise the cookie will not work! <script language="javaScript"> 'use strict'…
-
1
votes1
answer145
viewsA: Error installing Babel npm package in my project
Solved the problem! I was trying to install the Babel package by the git prompt. And it seems that this didn’t work. But redoing the same process using the Nodejs prompt worked. In case someone has…
-
1
votes1
answer145
viewsQ: Error installing Babel npm package in my project
I am trying to install the Babel package in my project. But while running the command: npm install --save-dev Babel-cli, an error occurs in the installation of tar.unpack. See in the image: I tried…
-
0
votes1
answer254
viewsA: Validate IP in javascript / html
You can use jQuery Mask Plugin. See: // jQuery Mask Plugin v1.14.0 // github.com/igorescobar/jQuery-Mask-Plugin (function(b){"function"===typeof…
-
4
votes1
answer201
viewsQ: Best ways to use Module Pattern in javascript
I am working on a project and using the standard Module Pattern javascript. But during the implementation of the project I had some doubts. First doubt: Is there any difference between the two ways…
javascriptasked alan 1,908 -
3
votes1
answer119
viewsA: Online Calculator Applying Fine and Discount
Edited Let’s go. Well, I checked your code and I understood better how it works. Here is the result. <script> window.onload=function(){ function getClosest(el, tagName) { while (el =…
-
1
votes1
answer880
viewsQ: jQuery - Using event click on div father and son
I have two div. I am trying to do the following. When I click on the father div it should return the Alert. But when I click on the div child nothing should happen. I tried something below but did…
-
1
votes2
answers340
viewsQ: Modules vs Classes in Javascript
I’m starting to work with Javascript Classes. But I see that some people use and recommend the construction of a project separated by modules. As I still have no experience working in these formats,…
-
5
votes3
answers1017
viewsQ: Is there a limit or restriction on variable name sizes?
When I started programming they said it was good practice to abbreviate variable names to shorten their size. However, I have recently researched and seen that this concept has changed. And today in…
javascriptasked alan 1,908 -
0
votes1
answer183
viewsQ: How to authenticate access to a directory in classic ASP
I have a system made in classic Asp and within its structure I have a videos folder. Is there any way to authenticate the access to this folder? I searched a few ways using web.config, but was…
-
1
votes2
answers60
viewsA: How to add "www." to a website with web.config?
I ended up doing it in a similar way. Follow the example for those who need: <rule name="Add WWW" stopProcessing="true"> <match url="^(.*)$" /> <conditions> <add…
-
0
votes2
answers60
viewsQ: How to add "www." to a website with web.config?
I do not have much knowledge in regular expressions and I am trying to identify if when accessing the site the user typed www before the name of the site. In case he hasn’t typed, I have to add. But…
-
1
votes1
answer1880
viewsQ: How to apply formatting to the parent element through the child element class with CSS or SASS?
I have the following structure just for example: <div> <div class="filho">teste</div> </div> I have the class .filho with a position: absolute; I wonder if through class…
-
8
votes3
answers1491
viewsQ: Is it good practice to use composite keys as the primary key?
I don’t have much knowledge in database structuring. I have been trying to improve myself and I am seeking best practices on how to create and structure tables. Currently I usually create link…
-
6
votes2
answers188
viewsQ: What is the difference between the following ways of using the jQuery ON and OFF methods
1 - I used to use this way: $(document).off('evento', 'elemento', nomeFuncao); $(document).on('evento', 'elemento', nomeFuncao); 2 - But recently I used it and it worked the same way.…