Posts by Fabrício Matté • 935 points
9 posts
-
7
votes1
answer862
viewsA: Javascript Startup of Objects
Like $scope.perfilDeAcesso.itensPerfilDeAcesso is an empty array, $scope.perfilDeAcesso.itensPerfilDeAcesso[int] returns undefined. You must initialize it as an empty object before assigning…
-
5
votes1
answer1863
viewsA: Difference between using the main element versus a div with role="main"?
The element main has the semantics role="main" implicitly by default. Reference (in English): Language feature | Default implicit ARIA semantic | Restrictions…
-
6
votes1
answer986
viewsA: How to change the value of the meta tag?
"View source" shows the response served for the HTTP request. It is not possible to change the content of this response using a client-side language. Javascript alters the GIFT which is the…
-
2
votes1
answer304
viewsA: How do I know which State I’m coming from using ui-router?
This feature was suggested in the ui-router repository (Github Issue (in English)) and seems to have a feedback positive, but for now there is still no simplified way to get this information. A…
-
4
votes2
answers634
viewsA: ajax duplicating div
Create a div to receive the Ajax response: <div id="exibeCep" class="conf_frete"> <h1>Escolha a opção do frete</h1> <div id="cepAjax"></div> </div> Then use it to…
-
1
votes1
answer227
viewsA: Using Cycle2 and "picturefill" together
By default, the jQuery selector of slides of Cycle2 is > img (selects only images directly from .cycle-slideshow). You need to change it to match with your marking. picturefill uses spans for…
-
18
votes4
answers13342
viewsA: Multiple lines of text or code with method ". html()"
Javascript does not allow literal line break characters inside strings. There are several ways around the problem. If you really want line breaks inside the string, use \n: $( '.qualquerClasse'…
-
12
votes5
answers16498
viewsA: How can we not apply opacity to a child element?
I don’t think it’s possible, but there is workarounds. If you need opacity only in the background, you can apply a color rgba: background-color: rgba(0,0,0,.7); Fiddle. Note that there is no support…
-
15
votes4
answers66720
viewsA: What is the correct way to make a regular Javascript substitution for all occurrences found?
Here is a way: String.prototype.replaceAll = String.prototype.replaceAll || function(needle, replacement) { return this.split(needle).join(replacement); }; Just put it before any other script you…