How does this code work? I would like a detailed explanation if possible and to know where there is documentation about it.
if (!+[]+!+[] == 2) {
document.write('Somos iguales');
}
else {
document.write('Somos distintos');
}
How does this code work? I would like a detailed explanation if possible and to know where there is documentation about it.
if (!+[]+!+[] == 2) {
document.write('Somos iguales');
}
else {
document.write('Somos distintos');
}
I was dealing with the dilemma of converting accents and special characters from my system.
It happens that now some of the data obtained from the BBDD that have accents come out with this: �.
The strange thing is that there can be up to 20 data displayed with accents but only some come out, so SANCI�N
what could be happening?
The only way is to put this<meta http-equiv="content-type" content="text/html; charset=UTF-8">
But despite being on the forms, in some cases the �
Dynamically generated data gives that error
CONNECTION DATA:
config.ini
;<?php
;die(); // /* No modificar sino sabe lo que hace */
;/*
[database]
driver="mysql"
host="localhost"
port="3306"
schema="bbdd"
username="root"
password="pass"
encode="utf8"
;*/
Connection.php :
<?php
<?php
$file = 'config.ini.php';
$config = parse_ini_file($file, true);
$host = $config['database']['host'];
$user = $config['database']['username'];
$pass = $config['database']['password'];
$schema = $config['database']['schema'];
$encode = $config['database']['encode'];
class conexion extends mysqli
{
public
function __construct($host, $user, $pass, $schema)
{
parent::__construct($host, $user, $pass, $schema);
if (mysqli_connect_error())
{
die();
}
}
}
$conexion = new conexion($host, $user, $pass, $schema);
mysqli_set_charset( $conexion, $encode);
?>
I am integrating a javascript library called chart.js in a php page that I am making and I have seen that in their examples they use the function
window.onload
instead of $(document).ready()
and the doubt that gives name to this question has arisen:
What is the difference between window.onload and $(document).ready()?
I've found a similar question on English SO called window.onload vs $(document).ready() but it's not entirely clear to me as my English is not very good.
I would appreciate if someone can solve this question for me. Cheers
According to Wikipedia , the programming style is:
Programming style (also called code standards or code convention) is a term that describes conventions for writing source code in certain programming languages.
Programming style is often dependent on the programming language chosen to write. For example, the style of the C programming language will vary from that of the BASIC language.
In several languages there are style guides that we could call "official" as in the case of PHP and Python, although they are a recommendation, not a mandatory standard:
In HTML, CSS and JS I use the Google style guides:
My question is:
Are there other more recognized or "official" style guides for HTML, CSS and JS?
Since in jQuery it is possible to change the visibility of an element, how can I tell if an element is visible or not at runtime?