Posts by Lollipop • 4,918 points
260 posts
-
2
votes1
answer443
viewsA: Store several values in the same instance of a PHP session
Learn how to program using classes and objects. For example... Using this class: <?php class Cart { /** * An unique ID for the cart. * * @var string */ protected $cartId; /** * Maximum item…
-
2
votes2
answers120
viewsQ: Limit INNER JOIN query to only one ID
I’m performing the following consultation: SELECT enquete.image, enquete.status AS status_enquete, enquete.id AS id_enquete, enquete.title AS titulo_enquete, perguntas.id AS id_pergunta,…
-
0
votes1
answer19
viewsA: How to know the change a plugin made in Wordpress
The answer is in your plugin. If it does: "Insert background color to menu items" and you want to know how it puts that color, you have to understand about: add_action( 'wp_head'...,…
-
0
votes1
answer26
viewsA: Pagination PDF wordpress
You can use the ISSUU. You can insert a static html, on any page, after registering your magazine there and see on your site, with paging, zoom, etc... <div style="width: 100%; height: 500px;…
-
0
votes2
answers62
viewsA: Wordpress plugin to restrict access to files only after registration
1 - Create a custom post type. 2 - Install the ACF plugin. 3 - Create a field group, called: PDF 4 - Create the rule to be shown only for your custom post type 5 - Create the fields to put the pdf,…
-
0
votes3
answers279
viewsA: How to execute an insert only once via javascript/jQuery
If you want to understand when the FOD is changed you should use Mutationobserver. This allows to define a callback that executes whenever there is a change in a given element and its descendants.…
-
1
votes1
answer141
viewsA: Perspective effect with Javascript Canvas
Use the Perspective.js SOURCE (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof…
-
3
votes3
answers992
viewsA: Concatenate elements
Every attribute value of div, must come between "". In the case of using js must be: ... id="'+valorID+'" ... Follows below your code refactored: var valorID='meuID'; var valorPosicao=20;…
-
1
votes2
answers93
viewsA: Call app.service when reloading the page
In Angula 2+ you don’t work in a linear way, hoping to carry this or that first... Have a shared service between all components. Within the service, declare a variable that contains the value you…
-
3
votes2
answers2049
viewsA: Sort CSS DIV positioning
This solution uses CSS only and works with dynamic content wrapper { display: table; } firstDiv { display: table-footer-group; } secondDiv { display: table-header-group; } Or flex-box /* -- Where…
-
1
votes2
answers148
viewsA: Remove content after added in javascript
Follows a refactoring: var list = document.getElementById('motivos'); var lastid = 0; function changeText2() { var firstname = document.getElementById('motivo').value;…
-
0
votes2
answers1133
viewsA: How to login validation in Angular?
In his makeLogin() use the subscribe: .... this._authService.getUser(this._user ) .subscribe( res => { if( [ CONDICAO AQUI DO RETORNO DO res] ){ this.userAuthenticated = true;…
-
3
votes5
answers3268
viewsA: Make lamp light on and off
Let`s Go! $('.cube-switch .switch').click(function() { if ($('.cube-switch').hasClass('active')) { $('.cube-switch').removeClass('active'); $('#light-bulb2').css({'opacity': '0'}); } else {…
javascriptanswered Lollipop 4,918 -
0
votes1
answer2310
viewsA: Update data automatically without refreshing the page
meu_script.js <script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ setInterval(function(){…
-
1
votes1
answer32
viewsA: Run script only when the screen is off
When it comes to routine device: detect shutdown mode. On android, for example, we have the: Intent.ACTION_SCREEN_OFF and ACTION_SCREEN_ON You won’t get anything ONLY with javascript... Study what…
-
0
votes2
answers490
viewsA: Two jquery masks in a field
You can use the toggleClass and alternate the Mask Follow example code:| $(document).ready(function() { $(".cpf_cnpj").mask("999.999.999-99").attr('placeholder', '000.000.000-00');…
-
1
votes1
answer369
viewsA: Blur event problem with Submit button
Use the: keyup (click Run to see an example) <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>…
-
1
votes1
answer108
viewsA: Separate data from multiple forms with Formdata
According to the commentary, the assembly of the append should be: 'cores[' + index + '][imagens][] 'cores[' + index + '][tamanhos][] ....
-
0
votes1
answer293
viewsA: Input file as append in Formdata
Try it with this: var data = new FormData(); $.each($("input[type='file']")[0].files, function(i, file) { data.append('cores[imagens][]', file); }); $.ajax({ type: 'POST', url: '/sua/url', cache:…
-
0
votes1
answer198
viewsA: Caching a JSON query in IONIC 3
Use the The Ionic Storage: ... import { Storage } from '@ionic/storage'; @NgModule({ ... providers: [ Storage ] }) export class AppModule {} ... import { Storage } from '@ionic/storage'; export…
-
5
votes2
answers3796
viewsA: "date(): It is not safe to rely on the system’s Timezone Settings..."
You probably need to put the time zone on a configuration line in your php.ini. You must have something like this in your file php.ini: [Date] ; Defines the default timezone used by the date…
-
0
votes0
answers36
viewsQ: Error creating json cookie with jquery
I’m trying to create a simple cookie with a json key value, but I’m getting it from the browser (click on the photo): This is the plugin I’m using Code, it goes below: $.cookie("gavetaMilagres",…
-
0
votes2
answers114
viewsA: Selecting a Specific Value in Jquery Array
Since the existence test is based on id you can use map to catch only id and index. This gives -1 if there is no or a positive index when there is. //Essa é a lista var arrayList =…
-
0
votes2
answers597
viewsQ: How to remove an object from an array, if it exists, with json string
I’m trying to create a kind of wish list. By clicking on a button/product it populates or excludes, if it already exists. However, I cannot exclude, I can only include. I tried to use the splice,…
-
0
votes1
answer98
viewsA: Woocomerce (wordpress) charges digital product shipping/download
Here should be the solution. You may have allowed orders:…
-
1
votes1
answer5981
viewsA: How to Update mysqli Database Table with UPDATE?
Try for the ID. The problem may be in Where. You must be looking for something that does not exist: $up = mysql_query("UPDATE cadastro3 SET nome ='$Nome',experiencia='$experiencia',email='$email'…
-
0
votes3
answers1300
viewsA: GET via jQuery on a different server, problem with CORS
I created a class to help solve this problem: /* * Função Auxiliar para resolver o problema no chrome */ Auxi::Cors(); Here is the class: <?php final class Auxi{ public static function Cors() {…
-
1
votes1
answer47
viewsA: Webplayer modifiable with JS
You use attr jQuery to create your playlists, for example: Source $(function() { $("#playlist li").on("click", function() { $("#videoarea").attr({ "src": $(this).attr("movieurl"), "poster": "",…
-
1
votes1
answer760
viewsA: Download image only by its URL
With pure javascript you can download an image with only URL, but first you need to convert it to file and "play" within an html and force the download. Understand that the code below runs a…
-
4
votes2
answers718
viewsQ: Create two lines with Owl Carousel inside a foreach
I have a loop that brings 12 images or more. The presentation of these images should follow the following layout: So as soon as the "next" if pressed a new block will appear with 6 more items…
-
0
votes1
answer94
views -
0
votes1
answer94
views -
0
votes2
answers609
viewsA: Align DIV with Absolute position to another DIV with FIXED position
The div <header id="header" class="pagewidth"> precise is with position: fixed; and the class .metaslider with position: absolute; top: 0; z-index: 0; Everything will go up, but then if you…
-
2
votes1
answer80
viewsA: Image does not appear 100%
Follow the explanation in the code: .parte1 { min-height: 100%; max-height: 100%; padding-top: 50px; padding-bottom: 50px; text-align: center; color: #f8f8f8; background-image:…
-
0
votes2
answers79
viewsA: Remove Download after page fully load
Normally, you can use window.onload, but you may notice that recent browsers do not trigger window.onload when you use the buttons/history forwards or backwards. Some people suggest strange "things"…
-
1
votes1
answer336
viewsA: How to encode json with multiple objects in PHP
The problem was that the variables $horario and $dias were passing an array, so when there was more than one loop in the for he created a [] in the json then I determined the index [0] and it…
-
1
votes1
answer336
viewsQ: How to encode json with multiple objects in PHP
I need the following result: { "sala": [{ "horario": "18:30", "data": "Seg e Terça" }, { "horario": "10:30", "data": "Quarta Terça" }] } UPDATE I’m doing it like this in PHP: /*criando objeto…
-
1
votes0
answers244
viewsQ: Edit image by adding an IONIC frame
with Cordova-plugin-camera I can already take a photo and manipulate the location of the file, but there is some other plugin or method to apply something to the photo, as a frame? 1 - I take a…
-
1
votes3
answers129
viewsQ: Detect text within a special character and convert it into a PHP function
It is possible to walk a textarea to detect a text within the character [text] and turn it into a PHP function? In short: 1. Scroll through a textarea 2. Find a text containing around [] 3. Convert…
-
2
votes4
answers8644
viewsA: How to take the "src" value of an "img" tag through Javascript and copy it to clipboard?
Below an example made with pure Javascript. var reply_click = function() { alert("Copiado para a área de transferência"); //Criando um "hidden" input var aux = document.createElement("input"); //…
-
0
votes1
answer26
views -
0
votes4
answers912
viewsA: Add variables to obtain end date
You can use the function strtotime() PHP to perform several operations between dates including adding: ini_set('date.timezone','America/Sao_Paulo'); $datainicio = '28-03-2016'; $meses = '2';…
-
0
votes1
answer93
viewsA: Is it possible for htaccess to interpret a file as a directory (subdomain)?
Your link tags and the way you will open your content, you will have to change it yourself. So where you used: ajuda.php?go=faq Now you will write: ajuda.php/faq Its rules need to translate the…
-
1
votes1
answer1059
viewsA: "Call to Undefined method mysqli_result::fetchAll()" in PDO
Solved by setting a single connection type to: $con = new PDO('mysql:host='.self::DB_HOST.';dbname='.self::DB_NOME, self::DB_USER, self::DB_PASS);
-
-1
votes1
answer1059
viewsQ: "Call to Undefined method mysqli_result::fetchAll()" in PDO
The following code displays an undefined method error on the line: $result = ($exec!==false)?$exec->fetchAll(PDO::FETCH_ASSOC):$exec; public function getConnection(){ global $conn; $this->conn…
-
1
votes2
answers412
viewsQ: Filter Images by Category with Angularjs Checkbox
Precise filtrar MAN and FEMALE. In the filter list, 4 items appear, and should appear only 2(man and woman), that is to say, by category. Another problem is that the filter is by…
-
0
votes1
answer240
viewsQ: Uncaught Referenceerror: Ionic is not defined
I’m trying to perform a "Android Push Notification" with the Ionic.io. I’m caught in a mistake I can’t fix: "Uncaught Referenceerror: Ionic is not defined" I’ve tried everything and I can’t fix it.…
-
0
votes2
answers119
viewsA: How to avoid the spread of the toggleClass method in the click event
The method not(), helped me solve the problem with the method removeClass() who pass the selectors I need. $(".mapDesc").not("#" + $(this).attr('id') + "-desc").removeClass("modal-celebration");…
-
0
votes2
answers119
viewsQ: How to avoid the spread of the toggleClass method in the click event
In the code below I have two toggleClass(are in total 12) that are working properly, but I need it to be expanded only 1, that is, if I expand the primeiro and then the second, immediately the…
-
1
votes2
answers527
viewsQ: Precision problem in Geolocation maps V3
I’m creating a web localization app, using geolocation of google maps v3. The problem is that when my functions work, they can’t get my location CORRETA NO Chrome do COMPUTADOR, but when I use the…