Questions tagged as 'javascript'

1
answer

How do I get current url in Javascript?

I'm using jQuery. How do I get the current and complete URL path, I want to assign it to the current url variable. $("#id_ativo").change(function(){ $.ajax({ type: "POST", url: url_atual, ...     
asked by 23.07.2015 / 22:34
2
answers

How to split a string into array in JavaScript?

There is an elegant way to split a string into an array based on the example: var x = "FAT* FAT32*"; And that would result in something like this: x[0] = "FAT*"; x[1] = "FAT32*";     
asked by 22.01.2015 / 14:24
4
answers

javascript error if

I'm not able to do a condition with if for example: asd=true; if(asd=='true'){ alert('funcionou'); } but it seems that somehow it is not entering if     
asked by 25.03.2014 / 16:51
2
answers

How to check if a response (date) is a json

How can I check if a result (date) coming from an ajax request is json or not? I tried this code but I did not succeed var obj = $.parseJSON(response); if(obj.avatar) { } else { }     
asked by 10.12.2014 / 18:35
2
answers

indexOf starting at the right

Problem I would like when I make "asdhusaidhi asdhasuidhu".indexOf('s') it would return 17 referring to the last s of the string, for example, it start looking for the right .. but instead it returned me 1 for the fi...
asked by 01.04.2015 / 16:46
2
answers

Bottom flap menu

I would like to know how to create a menu like this in a table row? Or what's the name I'm looking for ...     
asked by 04.09.2014 / 02:28
3
answers

Check the runtime of a Javascript function

I would like to know if it is possible to know the running time of a particular javascript function. This function does not need to fetch external data, it can only handle form tags, set value, calculate fields, like this: function idade(an...
asked by 10.07.2015 / 14:52
3
answers

How to play items with a specific value for starting an array?

I have an array questions [] with the following properties: perguntas[0] = { id:1; ordem: 3; inicio: 1 }; perguntas[1] = { id:2; ordem: 2; inicio: 0 }; perguntas[2] = { id:3; ordem: 1; inicio: 1 }; I would like to change them to order in t...
asked by 01.12.2014 / 14:30
3
answers

How to go to a link when clicking a div without using href

I need to redirect the page to a specific link by clicking a div , without using <a href> of HTML. I'm using HTML, CSS and jQuery and PHP. Here's a snippet of code: <div id="btn-oculto2" style="display:none;">...
asked by 01.01.2015 / 15:23
2
answers

Truthful and false values

What's the difference between true and false (directly speaking) to truthy and falsy in JavaScript? Are only true and false values of "third party", for example of a variable?     
asked by 24.01.2018 / 22:36