Posts by Gabriel Gartz • 5,624 points
78 posts
-
3
votes2
answers268
viewsA: How to create "html canvas"? (I think it’s new in html)
This is about a Custom Element, provided in the HTML5 API for Web Components. Today most browsers still do not support natively, as many of the parts the Apis that make up the Web Components are…
-
1
votes3
answers968
viewsA: How to run Url.Content via Client?
Use instead of ~ one . to indicate which is relative to the HTML position. $("#element").html('<img src="./Content/img/teste.jpg" />'); If your page is on /NovoSite/ will stay:…
-
3
votes3
answers255
viewsQ: How to clear the cache in Opera 12?
So, I am developing with focus on Opera 12, it has a very interesting debugger, similar to Chrome, but one thing that bothers me a lot is that refresh does not clean the browser cache, often close…
-
8
votes6
answers20131
viewsA: Difference between single and double quotes in PHP
In PHP, the single quote is not interpretive, it is a string and only that, the double is processed, so it can contain variables that will be converted when executing the string. For example: $foo =…
-
2
votes2
answers585
viewsA: Algorithm for calculation and distribution of elements on the screen
I recommend using Masonry for this, it’s very simple: http://masonry.desandro.com/ It does not depend on jQuery, but can be used integrated with it. Source code: /*! * Masonry v3.1.4 * Cascading…
-
6
votes5
answers1446
viewsA: Is it possible to include elements in the DOM after it is loaded and ready?
I think the point is not to add values in the DOM, because you said yourself that you are doing this, is to manipulate them so that they recover their state when browsing the page. One way is to…
-
3
votes2
answers1256
viewsA: Make a site with multiple pages offline
In HTML5 there is the api Application Cache, which is exactly to manipulate the cache to have an application that works in offline mode. Read, which can be installed in the user’s browser. This is…
-
2
votes4
answers1175
viewsA: Function to expand list
The problem is that you’re trying to make a loop iterating between letters and that’s impossible, it has to be numbers. Example: for (var idx='A'.charCodeAt(0), fim='Z'.charCodeAt(0); idx <= fim;…
-
5
votes3
answers19533
viewsA: How to do a Ubmit sending filled data in the form to an email?
The browser does not send email, but it is possible to create a link that already calls the user’s email client, with address, subject and formatted content so that the email can be sent. Following…
-
7
votes6
answers8117
viewsA: How to remove a "href" from a <a> tag with Jquery/Javascript?
There are several ways, by pure javascript the ideal is that you use the reference of your element and in it use the method removeAttribute, examples:…
-
13
votes1
answer2014
viewsA: What is the difference between apply, call and bind methods when calling a function in Javascript?
They are all prototypes of the object Function where it aims to perform a function by passing through it a different context and arguments. call: context, param1, param2, param3, ... apply: context,…
javascriptanswered Gabriel Gartz 5,624 -
1
votes3
answers403
viewsA: What is the benefit of working with webSql?
The Websql is a Sqlite-based solution, which because it is synchronous requests and has restrictions on the implementation behind the API was abandoned by W3C. However it is still available in…
-
9
votes7
answers43303
viewsA: How do I know if a variable is of the Javascript Number type?
Javascript has a native function to check if it is not numerical by testing it next to weak typing isNaN. So if you want to know if it’s numerical you can use !isNaN and it will return true to any…
-
3
votes4
answers11708
viewsA: How do I call a function by pressing Enter in <input>
Native Javascript: document.addEventListener('keydown', function (event) { if (event.keyCode !== 13) return; // Aqui seu código }): jQuery: $(document).on('keydown', function (event) { if…
-
11
votes6
answers15594
viewsA: How to do a search ignoring Javascript accent?
An interesting solution is to create a regular expression with the pattern you want to look for, in order to include all possible accents, so would give match at the desired value. Code to create…
-
0
votes5
answers16498
viewsA: How can we not apply opacity to a child element?
I’ve been through a similar case, but Opacity in Javascript is always inherited by the elements, there’s no way you can remove it, so what I usually do is create an element that stays exactly in the…
-
0
votes4
answers1519
viewsA: How to change the appearance of the site according to the device used, without having to script on the client or server?
I don’t think I can explain exactly what you’re looking for with a simple answer, but I recommend giving a read in this article, that will enlighten you some techniques for your layout to be…
-
3
votes1
answer144
viewsA: Set "currentTime" audio in HTML5
You should wait until the audio file has uploaded to apply the currentTime, example: var audio = new Audio('musica.mp3'); audio.play(); audio.addEventListener('canplay', function() {;…
-
0
votes2
answers611
viewsA: How to check if there is a function in Titanium Studio?
If you added an element to a property onclick, can test it, for example: if ($.minhaview.onclick) { // faça algo... } But if you added the event with addEventListener('click', evento) ai the answer…
-
5
votes1
answer82
viewsA: How to add customElements support for Opera 12?
After much research on the subject, I discovered that there is a polyfill that was made by the Polymer team, which is independent of the plataform.js and adds modern browser support to Custom…
-
4
votes5
answers12033
viewsA: How to change the value of a "date" attribute in Jquery?
data-* are customizable attributes of HTML elements, it is stored as a string property in the element’s dataset object. If you’re saving a list of values in it, you’re actually concatenating string.…
-
3
votes6
answers14692
viewsA: How to create a Git server on the internal network?
To start a GIT repository anywhere, just type in: git init If the folder where this repository is is accessible local, usb, or network, it passes you will be able to push it to your other repository…
gitanswered Gabriel Gartz 5,624 -
3
votes8
answers26648
viewsA: How to backup Mysql Database Diaries?
In linux you can use crontab to perform this task daily. Typo: crontab -e Add the line by replacing the values with your server: 0 23 * * * mysqldump -h localhost -u usuario -psenha meuBanco >…
-
6
votes1
answer82
viewsQ: How to add customElements support for Opera 12?
I’m working with customElements, but I’ve been having problems with Opera 12. So far the best I could do is use x-tags but the same of support only to the document.register and this differs a little…
-
5
votes7
answers12436
viewsA: Use semicolon or not at the end of the lines in Javascript?
The point and comma in Javascript is used to force the interpretation of the syntax in a line, delimiting this execution to the passage that precedes the point and comma. You are not required to use…
-
1
votes4
answers289
viewsA: How do I send a "textbox" always to the right when it’s in focus?
A simple way to solve this is, if the value is 0.00 you clear the field when there is Focus in it. document.querySelector('input[type=text]').addEventListener('focus', function () { if (this.value…
-
4
votes2
answers4076
viewsA: View saved PDF file in a Mysql database
You can use the method fpassthru() PHP to pass your BLOB data directly to the PHP the user is accessing. http://www.php.net/manual/en/function.fpassthru.php Example using LOB (Large Object):…
-
0
votes7
answers19609
viewsA: How to catch an element inside an iframe?
Access to iframes and frames only possible when the full domain is equal (this includes subdomain and port). If one of these is different your browser will ignore any access to the target’s DOM,…