简体   繁体   中英

Getting null values when using ajax serialize method

<script>
$( document ).ready(function() {
$("#inputval").ready(function(){
var querystring = $(this).serialize();

alert(querystring);
$.ajax({
url: "/example",
type: "POST",
data: querystring,
})

});
});

</script>

` this is the script am using. someone kindly help me to find out what am doing wrong.

<script>
$( document ).ready(function() {

var querystring = $("#inputval").serialize();

console.log(querystring);
$.ajax({
url: "/example",
type: "POST",
data: querystring,
})

});

</script>

Credits & thanks to- http://stackoverflow.com/users/4114297/paulgv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM