Fetch loading data from API Rest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const content = document.querySelector('#content'); | |
async function fetchUsers() { | |
try { | |
const users = await fetch('https://jsonplaceholder.typicode.com/users'); | |
const usersJson = await users.json(); | |
console.log(usersJson); | |
showHtml(usersJson); | |
} | |
catch(err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Add description item menu */ | |
add_filter('walker_nav_menu_start_el', 'agregar_descripcion', 10, 4); | |
function agregar_descripcion($item_output, $item, $depth, $args) { | |
if( !empty( $item->description ) ) { | |
return str_replace('</a>' , '<span class="description">' . $item->description . '</span></a>', $item_output); | |
} | |
return $item_output; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Se ejecuta cuando hay un archivo | |
$('#guardar-registro-archivo').on('submit', function(e) { | |
e.preventDefault(); | |
var datos = new FormData(this); | |
// console.log(datos); | |
$.ajax({ | |
type: $(this).attr('method'), | |
data: datos, | |
url: $(this).attr('action'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once 'funciones/sesiones.php'; | |
include_once 'funciones/funciones.php'; | |
include_once 'templates/header.php'; | |
include_once 'templates/barra.php'; | |
include_once 'templates/sidebar.php'; | |
?> | |
<!-- Content Wrapper. Contains page content --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once 'funciones/funciones.php'; | |
$nombre = $_POST['nombre_invitado']; | |
$apellido = $_POST['apellido_invitado']; | |
$descripcion = $_POST['descripcion']; | |
if($_POST['registro'] == 'nuevo') { | |
// $respuesta = array( | |
// 'post' => $_POST, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once 'funciones/funciones.php'; | |
$nombre = $_POST['nombre_invitado']; | |
$apellido = $_POST['apellido_invitado']; | |
$descripcion = $_POST['descripcion']; | |
if($_POST['registro'] == 'nuevo') { | |
// $respuesta = array( | |
// 'post' => $_POST, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
//Js Code Here | |
// Se debe colocar para que entienda Elementos de ES6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="button" onmouseover="sobreBoton();" onmouseout="afueraBoton()">Button</button> | |
<script> | |
function sobreBoton() { | |
document.getElementById("button").innerHTML = "Welcome"; | |
} | |
function afueraBoton() { | |
document.getElementById("button").innerHTML = "Thanks"; | |
} |
NewerOlder