webtuto Posted June 19, 2009 Share Posted June 19, 2009 hi , i used jQuery to put data on the database i always do the same code and it work but this time no anyway here is the code i used -> jQuery(function($) { $('#send').click(function() { var msg = $('#msg').val(); var time = $('#time').val(); url: 'to_db.php', type: 'POST', data: 'msg=' + msg + '&time=' + time, success: function(result) { $('#response').remove(); $('#messages').append('<p id="response">' + result + '</p>'); }; return false; }); }); but FIREBUG give me this error invalid label type: 'POST',\n hope you can provide me with the solutions , thanks in advance Link to comment https://forums.phpfreaks.com/topic/162878-invalid-label-jquery/ Share on other sites More sharing options...
RichardRotterdam Posted June 19, 2009 Share Posted June 19, 2009 look at the following url: 'to_db.php', That's how you usually set an attribute of an object in javascript however, you didn't start an object. now take a look at the following ajax code taken from the jQuery site $.ajax({ type: "GET", url: "test.js", dataType: "script" }); notice how it has $.ajax({ before type:"GET" that should prob solve your problem Link to comment https://forums.phpfreaks.com/topic/162878-invalid-label-jquery/#findComment-859758 Share on other sites More sharing options...
Ken2k7 Posted June 20, 2009 Share Posted June 20, 2009 Alternatively, $.get would be the same. Link to comment https://forums.phpfreaks.com/topic/162878-invalid-label-jquery/#findComment-860039 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.