Questions tagged as 'javascript'

1
answer

How to prevent the user from closing a page without sending the form, but without using a dialog?

I have an HTML page that has a form. I need to prevent that after the user completes this form, it click on another button of the page that is not the "Save". I found a script that solved this, but it can easily be circumvented. In this scrip...
asked by 06.01.2016 / 17:57
2
answers

How to set data in the localStorage

I have the following code: $scope.loginUser = function (user) { console.log(user); $http.post("admin/php/login.php", user).then(function(response){ if(typeof(Storage) !== "undefined") { localStorage.setItem("chave", "v...
asked by 06.01.2016 / 22:41
1
answer

Does anyone know with enable functionality to export PDF in DataTables

I'm using the js DataTables plugin but I'm not sure how to enable the export functionality for PDF or Excel. Can anyone help me? As of now, thanks.     
asked by 06.01.2016 / 18:40
1
answer

Receive URL parameter by JS (jQuery)

I need to capture a parameter from a URL, for example: http://site.com/paginas/**nome-da-pagina** I need to capture page-name with JS or jQuery.     
asked by 06.01.2016 / 14:00
3
answers

Search - Show Message if results are not found

I have a problem with the javascript, I got a js that does the search in the table, but when there are no records it just shows nothing, how do I put a "return" with some phrase when there are no records, I tried a few times but without success....
asked by 06.01.2016 / 04:29
4
answers

How to identify the focus on a div?

Galera I set up an input system with the same android layout. Everything works fine in% with% plots, but input provider is within input , as I have to add a button in place of x. The problem is that when I hold the mouse over...
asked by 19.02.2016 / 11:09
2
answers

Execute code only if the user is not on the tab

I would like to know how I can do to run a script (in this case it is those desktop notifications) only if the user does not have the open tab , ie I want to send a desktop notification to it only if it does not have the site open (I'm doing th...
asked by 18.02.2016 / 18:38
1
answer

How to insert CSS declared with Javascript after page scroll

Well, I just wanted to make the javascript function work: var $document = $(document), $element = $('#minhaDiv'), className = '.teste-css'; $document.scroll(function() { if ($document.scrollTop() >= 5) { $element.addClass(classNa...
asked by 18.02.2016 / 19:05
1
answer

window.history.pushState

I'm using the pushState function to populate history , so alright, but it's time to use windows.history.back() only to go back once. The function you add is as follows: function activate_page(sel, have_state) { var $dn...
asked by 07.01.2016 / 19:41
1
answer

I would like suggestions about this structure in JS

Good afternoon. Practicing a little, I decided to build a slider in javascript, and I chose to follow this line of construction with a constructor. The code is functional. However, I would like to encapsulate the entire code structure as much as...
asked by 26.12.2015 / 19:03