Posts by Seu Madruga • 2,481 points
88 posts
-
0
votes1
answer74
viewsQ: Do the crawlers/bots/web-Spiders of search engines copy and access the href of a link, or "click" on <a></a> to be redirected?
I have this doubt, because I want to develop a portal in Ajax, but that the pages can be accessed also via url. My question is: If the <a> </a> have with return false when clicking, the…
-
3
votes3
answers135
viewsQ: When we include a script or CSS file in the HTML document, does an HTTP request occur?
For example: <script src="file.js" > </script> or <link rel="stylesheet" href="style.css" > Doubt: When we do this, it occurs request HTTP? It would be more performative if I…
-
2
votes1
answer31
viewsQ: Instructions that depend on variables coming from "for" loop, need to be executed in callback?
For example: var soma = 0; for(var i = 0; i < 100; i++){ soma += i; } if(soma < 500){ console.log('Soma é menor que 500'); } My question is: Since the condition of if depends on the variable…
javascriptasked Seu Madruga 2,481 -
1
votes0
answers35
viewsQ: What is "Function" in parentheses for in Javascript?
I’ve noticed that there are codes more or less like this: <script> (function (parametros){}) </script> Other similar code: (function (val) { return val; })(123); What use is that?…
javascriptasked Seu Madruga 2,481 -
0
votes1
answer163
viewsQ: Function "Extract()" does not work inside the foreach loop
I have the following code: <?php $dados = array( "carro" => 'Ford Focus', "ano" => 2007 ); foreach($dados as $carros): extract($carros); endforeach; ?> The problem: If I inform the…
phpasked Seu Madruga 2,481 -
8
votes1
answer139
viewsQ: What is the correct use of the "in" javascript operator?
This code does not return anything, why? I am running in "window.onload event": if(innerHeight in window){ console.log('true'); } I had already used the operator other times, and it worked, but now…
javascriptasked Seu Madruga 2,481 -
3
votes1
answer149
viewsQ: Is it possible to know the number of lines a text occupies in a <p>?
I need it for some conditional ties, but I have no idea how to do it, or if it’s possible. Supposing I have a string, and I need to know how many lines it would take in a given paragraph…
phpasked Seu Madruga 2,481 -
1
votes2
answers482
viewsA: How to take bank line value and put in checkbox
Just give me one echo of the variable, within the value="" of input that you want. Example <?php $animal = 'gato'; ?> <input type="text" value="<?= $animal ?>" /> The variable…
phpanswered Seu Madruga 2,481 -
1
votes1
answer3932
viewsQ: Is there an API/Web Service that provides the names of existing cars?
I need it to be an up-to-date list of all car models, classified by brand. I am developing a classified site and I need this for the filtering of results. Is there any agency or body that provides…
-
2
votes1
answer775
viewsA: Pagination with friendly url
Cause What I noticed in your code, is that you are searching the parameter 'page' in the url by GET, only 'page' is part of a parameter that you set in the rewrite engine. If in rewrite you put…
-
5
votes2
answers973
viewsQ: How to make this slideshow infinite?
It’s a passing carousel, but the only way I could do it was like this: when it comes to the last slide, it goes back to the first one, making a kind of "return transition" to the beginning.…
-
0
votes3
answers109
viewsA: How to determine what will be loaded in HTML?
You can add a js code (jQuery) to the head, with the following condition: if($(window).width() < 901){ $("#header-video").remove(); } In short, if the screen is less wide than 901px, it removes…
-
2
votes0
answers53
viewsQ: How to detect if the page is scrolling down or up?
I would like to know how to do this, in javascript. It would be for a menu fixed at the top. It would appear when rolling the body up, and disappear when rolling down, but need to detect the…
javascriptasked Seu Madruga 2,481 -
1
votes1
answer46
viewsQ: How to set two (or more) css parameters at once?
I wonder if it is possible, in a scenario where the two values were equal. I would do this to advance the writing. For example, pass HEIGHT and WIDTH together: height, width: 50px; I tried to do…
cssasked Seu Madruga 2,481 -
13
votes4
answers21920
viewsQ: How to transform string into character array?
It is possible to transform string into character array? I only found it with the method .split(param); I’d like to convert a string in a array of characters, one character in each index. I would…
-
19
votes5
answers5742
viewsQ: Is it possible to develop websites with C/C++?
I know a little bit of PHP, but I see that on content sites, sometimes it gives a crashes and etc. Researching, I saw reports (very superficial) that it is possible to develop web applications with…
-
-4
votes1
answer76
viewsQ: How is this Hover effect done?
It’s the little colored ribbon that expands...…
-
0
votes1
answer1633
viewsQ: How to make a circular progress bar for web?
Like the image attached below…
-
1
votes0
answers571
viewsQ: How to make a side menu that expands by pushing the body?
In the style similar to that of this site here: LINK
-
9
votes2
answers202
viewsQ: Which is faster to read and edit, a database or a . txt?
It would be to store and rewrite only 1 digit INT, erasing one and writing another, on the condition that when it reaches 5, go back to 1, and go on doing that loop every time someone accesses.…
-
0
votes0
answers39
viewsQ: Keyword search problem, in Mysql
The problem is: How can I perform a search for results per keyword contained separately in the database? Ex: I search for "RED CARS". php executes the query "SELECT * FROM table WHERE field LIKE…
-
-1
votes1
answer3951
viewsQ: How to get the coordinates/position of the mouse cursor, in javascript?
Preferably without using frameworks.
javascriptasked Seu Madruga 2,481 -
4
votes1
answer52
viewsQ: Is it possible to make an html element expand upwards?
Ex: I have a paragraph inside a div, and I want that whenever the text breaks a line, it expands up rather than down (default). Take the example: #content { width: 200px; height: 200px; background:…
-
0
votes0
answers44
viewsQ: How to abbreviate/format php numbers, as on Youtube?
Ex: 10000 turns 10k, 1000000 turns 1M and so on? Well, I did it this way. If anyone has a better and more practical way, please let me know: function abrevNmr($numero){ switch(strlen($numero)){ case…
phpasked Seu Madruga 2,481 -
-1
votes1
answer126
viewsQ: How to delete elements from a jQuery collection?
For example: I want to give one .fadeOut() throughout body, but with the exception of some element, such as a div. Can this be done? How?
-
1
votes1
answer69
viewsQ: Date() object does not work in Mozilla Firefox
My Javascript code has a Date object, however this script only works in Chrome and IE, and in Firefox nothing appears, because it happens? Code: function relogio(elemento){ var target =…
javascriptasked Seu Madruga 2,481 -
5
votes2
answers701
viewsQ: How to do this effect of Hover?
The Hover effect from the menu of this site: http://www.jornaldacidade.net/ Is CSS3 pure? How to do something similar?
-
-1
votes2
answers717
viewsQ: How to identify the HTML element in which a js script is contained?
Like this: I put a js script inside a div, for example. How can I make this script identify the DIV in which it is contained without selectors like ID or Class? It’s just that I see some embed…
javascriptasked Seu Madruga 2,481 -
6
votes4
answers330
viewsQ: Problem with functions being performed multiple times
I would like to know how to remedy this problem. Example: I have a function of fadeIn/fadeOut. The event that triggers the function is the OnClick in some element. The point is: How to avoid that…
javascriptasked Seu Madruga 2,481 -
-1
votes1
answer288
viewsQ: Using Ajax in the navigation of the entire site has a problem?
It’s because the site would have a Web Radio, and I don’t want you to update every page exchange, because that’s for playback. I wonder if it is a problem to make the pagination in Ajax? And…
-
3
votes1
answer1759
viewsQ: Can you make a type of "setInterval" in PHP?
To perform certain function in a time interval.
-
2
votes1
answer37
viewsQ: Is it possible to count organic search visitors?
I wonder if there is any tool/api to know from which site the visitor came, to account for visitors coming from the search engines. Thank you all.
-
1
votes1
answer34
viewsQ: Does using libs as jQuery negatively influence a page’s loading performance/time?
I say because she uses many methods... This influences the loading of the page? Because I understand that the ranking of search engines takes into account the loading time of the site. So, a system…
-
1
votes1
answer99
viewsQ: Is it possible to pass text (json) via client-to-client socket with javascript?
Send data via socket, from one client to another, only with javascript? Preferably in pure js. Yes, Sergio. No server.
javascriptasked Seu Madruga 2,481 -
-1
votes2
answers953
viewsQ: It is wrong to use common variables within a PHP class
Is it a wrong form of POO? Can I only use attributes within my class? Can I use type variables $Variavel, when necessary? I mean, don’t use the public $variavel, or var $variavel, private $variavel.…
-
5
votes1
answer37
viewsQ: Problem when checking if a number is pure js module 2
I’m trying to do it like this: if(i % 2){ console.log(i); } i is the variable is coming from a for loop. Why isn’t it working?
javascriptasked Seu Madruga 2,481 -
3
votes1
answer452
viewsQ: Problem with onload event
I’d like to ask someone who understands pure javascript, why this is happening. I have a code that should only show the image when it is loaded (onload), only the function only fires when I Seto…
-
3
votes1
answer504
viewsQ: How to "concatenate" Javascript functions?
How does jQuery lib? Example: $(element). text('my text'); I want to know how to do a function like text() in pure Javascript, just to learn the theory. I want to know how the html element is passed…