0
What is GET and POST?
Can someone explain me what are GET and POST Request in Java Script and how they work?
9 odpowiedzi
+ 3
If this helps because it will be very long to explain it here in detail.
https://www.sololearn.com/learn/PHP/1841/
+ 1
GET and POST are values for the "method" attribute of html form tag. It specifies how are data transferred from the form. GET shows variable values in the URL, while POST doesn't. You should never use GET for sending passwords or any other sensitive data. Disadventage of POST is, that the page cannot be bookmarked in your broswer.
+ 1
In JavaScript you can use this.
var body = document.getElementsByTagName("body");
body = body[0];
console.log(body.innerHTML);
+ 1
You don't need to specify form's method when using JavaScript. You can get content of the input field using it's id as selector and get value of it's "value" variable.
+ 1
Using php you can get the data using this:
<form method=POST>
<input type=text name="data" action=scriptCointainingPhpCodeBelow.php>
</form>
<?php
echo $_POST['data'];
?>
0
Thanks. Can you explain me how to get data ( like the inner HTML from a body tag ) from a server, return it and send it to another server? With none Api.
0
Meet Mehta That's very helpfull for explaining. But how is the syntax in .js ?
0
https://code.sololearn.com/Wx3iK51xuuGS/?ref=app
Here I add a table cell with text submitted via HTML form using JavaScript.
0
Jan Štěch Sorry for asking, but how include this code in an POST/GET Request?