Skip to content

Instantly share code, notes, and snippets.

View kuroisuna's full-sized avatar
🐕
Probably working with javascript 🤔

Axel García kuroisuna

🐕
Probably working with javascript 🤔
  • Santiago, Chile
View GitHub Profile
@kuroisuna
kuroisuna / ajax.js
Last active November 26, 2015 20:00 — forked from coderdiaz/ajax.js
$(document).ready(function(){
$('#getDatos').click(function(){
$.ajax({
url: 'consulta.php',
success: function(data){
$("p").remove();
console.log(data); //<=== Esta puede ser removida;
var datos = $.parseJSON(data);
console.log(datos); //<=== Esta puede ser removida;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
<style id="jsbin-css">
header {
padding: 60px 0;
text-align: center;
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<style id="jsbin-css">