Username:
Password:
Remember me:
Register

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)


Search forums via Google


0 Users appreciate this thread.

How to use $.post (JavaScript)
Started by PLMasterSSB
(2014-01-24 14:12:40)
PLMasterSSB (2014-01-24 14:12:40)
first, you have to have something in your document containing text, or something that has value.

example:
<input type="text" id="text">

then, ofcourse you can enter text in it, then, grab the text in it with JS:

var mytext = document.getElementById("text".value;
(the id of the input field is "text"

then, you can use the $.post method. the $.post method is usually used to send data to another file for handling that data:

$.post('yourfile.php', {text: text});
// yourfile.php is where the data is going

then, put your PHP in that file for handling the text.
(say like some MySQL querys) you may also make the $.post method tell you when the data was sent to the file:

$.post('yourfile.php', {text: text}, function() {
//your code here
});

This post has been edited one or more times, the last time was:
2014-01-24 14:33:55

angelrulez7 (2014-01-27 04:30:15)
Don't use this, though. It's really not useful when PHP can do all the work.
a
(Capt.)Orb (2014-01-28 17:45:17)
I completely agree with Ar7.
Aviation fact: The a380 is the largest commerical aircraft in service!

Go to Splashiverse! Splashiverse
CoolApps (2014-04-20 14:18:25)
Don't use Javascript to do the job, it won't be good at all at the end.
User can disable JavaScript and they can most likely get an issue on their side.
So again, DON'T use JavaScript for this.
Newer account: NodePoint
 

Log in to submit a comment

This topic's ID: 67701

Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)




Total registered users: 8321
New registered users today: 7
Newest registered user: ElegantVulpes

©  Copyright 2026 3DSPlaza. All Rights Reserved