Questions tagged as 'jquery'

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
3
answers

Javascript: Give .hide on everything that is open

Good afternoon. I would like to know how to do it instead of writing: $("#removemirror3").click(function(){ $("#mirror31").hide("slow"); $("#mirror32").hide("slow"); $("#mirror33").hide("slow"); $("#add4mirror").hide("slow"); Writ...
asked by 05.03.2015 / 18:18
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
3
answers

How to "undo" any text at the time of "echo" and turn each word into a link

I made a database, and in that database I registered a phrase, I would like that when I was to echo the phrase, each word would become a single link. Ex: recue o código em 4 espaços The sentence is simple, but I would like each word to crea...
asked by 22.11.2014 / 20:44
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

What is the correct way to return a switch value?

How is the correct way to return the value of switch ? HTML: <h3 id="txtOcorrenciaStatus">Status</h3> Javascript: switch(ocoStatus) { case C: $("#OcorrenciaStatus").html("Concluído"); break; case A:...
asked by 27.12.2015 / 21:30
2
answers

Separate the value from the string

Colleagues. When calculating cart shipping, it is returning as follows: Iwonder,howdoIgetonlythevalue24.90?Well,Imustaddtothevalueofthecart.Seethecodesbelow:PHP$parametros=http_build_query($parametros);$url='http://ws.correios.com.br/calc...
asked by 17.03.2017 / 19:50
3
answers

JQuery monitoring keystrokes

I'm making a form, where the data is entered through scanning bar codes (default code 128). After scanning each value, the hand scanner is already configured to give <TAB> and move to the next field, making it very convenient to...
asked by 31.10.2017 / 19:31
3
answers

Escape Single and double quotes from the same text area giving crlt + V

// I want to just not let you enter single quotes and double quotes $('#bot').keypress(function (e) { var regex = new RegExp("^[a-zA-Z0-9-]+$"); var str = String.fromCharCode(!e.charCode ? e.which : e.charCode); if (regex.test(str)...
asked by 09.05.2018 / 18:50