I am doing this for the first time. i want a data of another HTML page using AJAX call and jQuery in HTML page. Below is mycode
this is my .js code
<script type="text/javascript">
$(document).ready(function()
{
$('#submit').click(function(){
var name =$('#name').val();
var pass =$('#passsword').val();
if(name=='' || pass==''){
alert('first fill the details');
}
else {
$.ajax({
method:'POST',
url:"login.html",
data:{name:name,
password:pass},
daatType:"HTML",
success:function(status) {
alert('success');
$('#div').html(status);
}
})
}
})
})
this is my Html code
<form>
<label>Name:</label><input type="text" id="name"><br>
<label>Password:</label><input type="text" id="password"><br>
<button type="submit" id="submit" >Submit</button>
</form>
<h2 id="div"></h2>
please help