I am making a request with ajax and javascript, the answer of this request is a complete html page, of this answer I need to obtain the value of an element <input type="hidden" name="key_solicitud" value="este es el valor que deseo obtener">
, I have tried with the following code.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Documento 1</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
<p id="html_response"></p>
<script>
$(document).ready(function(){
$.ajax(
{
type : 'GET',
crossDomain:true,
url: 'http://cartago.lllf.uam.es/grampal/grampal.cgi?m=etiqueta',
dataType: 'jsonp',
jsonp: 'callback',
callback: function(result) {
var mydata = $(result).filter('key_solicitud').value();
$('#html_response').html(mydata);
}
});
})
</script>
</body>
</html>
And several variants like find by filter (), $ (result) .filter ('key_solicitud'). text (); but I always have an error when getting the result
Uncaught SyntaxError: Unexpected token