Last active
August 29, 2015 14:15
-
-
Save nicastelo/124cb3ac94b04fb2be1d to your computer and use it in GitHub Desktop.
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
function hola(pene){ | |
var formURL = "/comprobar.php"; | |
$j.ajax({ | |
url : formURL+"?url=http://horadeaventura.enlatino.net/episodio/355", | |
contentType: "application/json; charset=utf-8", | |
datatype: 'json', | |
success:function(data){ | |
if(data.msg == "success"){ | |
var url1 = data.url1; | |
var url2 = data.url2; | |
var titulo = data.titulo; | |
var episodio = data.episodio; | |
$j("input[name='fuente1']").val(url1); | |
$j("input[name='fuente2']").val(url2); | |
$j("input[name='post_title']").val(titulo); | |
$j("input[name='numeroepisodio']").val(episodio); | |
console.log(title); | |
alert("Datos cargados correctamente."); | |
} else if (data.msg == "bad url"){ | |
alert("Revisa la URL. Has ingresado una url incorrecta.") | |
} | |
}, | |
error: function(jqXHR, textStatus, errorThrown){ | |
alert(" =/ Se ha producido un error inesperado."); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment