Questions tagged as 'javascript'

1
answer

How to put cursor: move in a draggable div with javascript?

I have the following excerpt of a div <div class="teste" draggable="true">CONTEÚDO DA DIV</div> I would like that when I drag this div on the screen the cursor would be in default, but the problem is that only with...
asked by 03.05.2017 / 22:12
1
answer

What is the most effective way to develop a html5 or js code?

For example when I want to do an event on the button click I can do it in two ways: using the onclick attribute of html5 <button type='button' onclick='myFunction()' id='btn0'>O</button> or by js: $('#btn0').click(func...
asked by 11.01.2018 / 19:49
2
answers

Show 'confirm' only after loading page

I'm calling the following function inside the page: window.onload = function() { acess(); } function acess() { decision = confirm("Deseja realmente excluir o servidor cadastrado abaixo?"); if (decision) { window.location...
asked by 02.01.2018 / 17:17
2
answers

How to bring the typed data and store in a json to do the treatment after?

I would like to get the data typed in my form and put it in a json, but I do not know how to do it. My HTML form looks like this: <form action="" class="formContent" id="myform"> <div class="row form-input" id="form"> <div...
asked by 20.02.2017 / 15:14
1
answer

Script this considers enter as white space

I made a script to remove whitespace from a string inside a TEXTAREA or INPUT, follow the code just below: input = 'input[type="text"]:not(.inputData), textarea'; $(document).on('blur', input, function(){ console.log('blur'); $(th...
asked by 16.02.2017 / 15:04
1
answer

Download a PDF received from an API with AngularJS

I have an API that returns me a PDF file. I want to make angular hitting this route and forcing the download of the PDF file. Today I do this: var blob = new Blob([arquivo], {type: "application/pdf"}); saveAs(blob, 'arquivo.pdf'); The...
asked by 15.02.2017 / 14:25
1
answer

What is the reason for this error "Uncaught ReferenceError: SambaPlayer is not defined"?

You are saying that "SambaPlayer" is not defined. <script> var xmlhttp = new XMLHttpRequest(); var url = "https://api.sambavideos.sambatech.com/v1/medias?access_token=847584758475847874858363&pid=3434&sort=DESC&limit=...
asked by 17.02.2017 / 13:46
1
answer

AngularJS - Where to put Jquery / JavaScript functions

I have some functions in jquery that would normally be in a .js file, but when I use Angular where should I put following the good practices? Example: I have a function that determines whether or not my Header is hidden depending on the size...
asked by 07.02.2017 / 21:27
1
answer

How to create a Gif with Canvas content

I would like to know how to create a gif from a canvas, on this canvas I have a sequence of scenes, after the scenes are created I wanted to read all the scenes and then save them as a .gif     
asked by 06.02.2017 / 20:03
1
answer

check empty input

I have an input text and want to check if the value is empty. In my example I have this: var qttDeclared = tr.getElement("input[name$='[qttDeclared]']").get("value").toInt() if(qttDeclared == "") { console.log("vazio"); } But th...
asked by 14.02.2017 / 09:19