Posts by Jonas Alves • 115 points
7 posts
-
0
votes0
answers58
viewsQ: How to cancel events like keypress, keyDown, ... from one key and activate them in another
I have been playing a flash game in the browser for a long time, and recently I acquired a notebook with a very different keyboard and wondered if I could have a Javascript script that I could run…
javascriptasked Jonas Alves 115 -
2
votes1
answer26
viewsQ: How to return substrings in a delimited string?
My problem is this: I have a string "Olá [eu] sou uma [string]", as I would to return the substrings that are within the delimiters "[" and "]"? *When I say return, I mean an array like the one of…
phpasked Jonas Alves 115 -
0
votes2
answers144
viewsA: How to identify a delimiter in a string with php?
$string = 'ola {cabra} aaa'; $rules = str_replace(array("{","}"), array('[',']'), $string); print($rules); //retorna: ola [cabra] aaa
phpanswered Jonas Alves 115 -
0
votes2
answers144
viewsQ: How to identify a delimiter in a string with php?
In my problem a delimiter is two strings that 'enclose' a part of another string in a given order. For example: '('and'}' are a string delimiter: 'aqui (tem} um delimitador'. My problem is how to…
phpasked Jonas Alves 115 -
2
votes3
answers1488
viewsQ: Cut text and add ellipsis
I need a function that cuts a text without cutting words, adding a "..." at the end.
phpasked Jonas Alves 115 -
4
votes3
answers207
viewsQ: I need a function to add <br> under certain conditions
I want a function that adds the tag <br> when the text is not spaced, I made a fiddle with the problem: https://jsfiddle.net/sc290ssn/. This function can be done in Javascript or PHP. <div…
-
0
votes1
answer320
viewsQ: Problems with textarea character counter
I want to improve this function, because when you break the line, it doesn’t count the characters properly: $(function(){ $("#maxlength").keyup(function(event){ var target = $("#content-countdown");…