var studno = $('#studno').val();
$(document).ready(function () {
$('.go').click(function () {
$('.inup').load('prochat.php', {
studno: studno
});
});
});
I have this code and it's supposed to send the value of studno into prochat.php but everytime it does it only says undefined. Can anyone explain?
Try this:
$(document).ready(function(){
$('.go').click(function(){
var studno = $('#studno').val();
$('.inup').load('prochat.php', {studno:studno});
});
});
Never mind. Turns out this works
$('.inup').load('prochat.php', {studno: $('#studno').val()});
This should work better:
$(document).ready(function () {
$('.go').click(function () {
$('.inup').load('prochat.php', {
studno: $('#studno').val()
});
});
});
Try this:
$(document).ready(function(){
$('.go').click(function(){
var studno = $('#studno').val();
$('.inup').load('prochat.php', {studno:studno});
});
});
These could be possible reasons:
possible solutions:
-. try assigning the value within the click function:
like this:
$('.go').click(function(){
studno = $('#studno').val();
$('.inup').load('prochat.php', {studno:studno});
});
-. make sure that the element with id studno exists in the html document