Posts by André Pereira • 329 points
16 posts
-
2
votes1
answer46
viewsA: block access to a javascript-only page
You can make a control using sessionStorage. In index.html: sessionStorage.setItem('usuarioLogado', '1'); In home.html: var usuarioLogado = sessionStorage.getItem('usuarioLogado'); if…
-
2
votes1
answer29
viewsA: Access an accordion variable from a child component to the parent
It is possible using @Input and @Output. As in this example, taken from the documentation: Child component - TS: import { Output, EventEmitter } from '@angular/core'; export class…
angularanswered André Pereira 329 -
2
votes1
answer39
viewsA: I CAN’T ALIGN MY SVG TO THE TEXT ON MY LIST
You can line up display: flex in the <li>: #nav-content li{ display: flex; align-items: center; padding-top: 1.3rem; }
-
1
votes2
answers30
viewsA: How to hide and enable a table line?
This is because the element display value is not block, but table-Row. This setting in the Changestatus() function solves the problem: function Mudarestado(el) { var display =…
-
1
votes1
answer1147
viewsA: How to import data to Json from a table in Excel
You can do this using some ferarmenta online like this one, or automate using this library for Node.js. You can convert the table to json in a very simple way: var parser = new…
-
0
votes1
answer24
viewsA: With Javascript is it possible to automatically execute a function on another part of the file?
Only with the frontend, you can pass the dates to the other file using localStorage, in timestamp format. Example: In the first file, you save in localStorage: var minhaData = new Date();…
-
1
votes1
answer32
viewsA: How to prevent a BODY CSS rule from being reflected in a particular Element contained in it?
It is not possible, because the child elements are part of it. The solution is to use a modal backlayer, which will also allow you to close the modal by clicking on it. Example: var openModalBtn =…
-
2
votes1
answer23
viewsA: how to make a horizontal scrollbar without using white-space: nowrap;
There is, that way: In .produtos-geral remove the white-space: nowrap;. In .el-produto add flex-shrink:0;. Ready :) You must also need to define height: auto;, or put a higher value.…
-
0
votes2
answers41
viewsA: Display json in different locations of my html statico
Are 2 problems: The first is that the code is placing a comma after each image. This is because the picture variable is an array, not a string. To solve, change ${imagens} for ${imagens.join('')}.…
-
1
votes1
answer31
viewsA: Javascript ,compare the background of a div by DOM
The element.style only allows you to access the specific styles of the element, that is, whatever is inside its style attribute. Use the window.getComputedStyle() to pick up the applied styles. In…
-
1
votes1
answer9
viewsA: Problem with scripts in Functions Wordpress
Is missing ; after wp_enqueue_style and wp_enqueue_script.
-
0
votes2
answers17
viewsA: Delete a certain category from Wordpress posts
You need to know which is the ID of the category you want to remove. Then add 1 line to your $args. Suppose you want to remove the category with ID 8: $args = array( 'orderby' => 'date',…
-
0
votes1
answer14
viewsA: Woocommerce - How to activate "zero rate" tax class for a user type and for a specific category?
You can use $product->get_categories() to list the product categories. So you can check whether or not the product is included in the desired category, and create a new conditional, just like you…
-
0
votes1
answer21
viewsA: Why is the data coming from the form only displayed after the resubmission of the form?
Probably the code that reads the data is running before of function addTask() be executed. That’s why it only appears after the page reloads. Try to run it before, or move the function addTask() to…
-
0
votes1
answer37
viewsA: How to remove html extension from urls
Try the code below. If it doesn’t work, there must be some block on your site’s server. RewriteEngine on RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC] RewriteRule ^ /%1 [NC,L,R] RewriteCond…
-
2
votes2
answers36
viewsA: Why is an HTML element found only in "onload"?
Out of onload the code is executed before the element <button>exist. Within the onload you ensure that the code will run only when the entire page is loaded. Therefore it is recommended to put…