Robert Glavaš Robert Glavaš - 1 month ago 6x
Javascript Question

Jquery div to PHP data

I have some java script:

$.getJSON("", function(data) {
var table_body = "";
$.each(data, function(k, v) {
table_body += "<tr><td>" + k + "</td><td><b>" + v + "</b></td></tr>";

<script src=""></script>
<div id="mojetrebam"></div>

My question is, how javascript result ('success') add in some PHP variable

$mystatus = "<div id=\"mojetrebam\"></div>";


Your PHP code $mystatus = "<div id=\"mojetrebam\"></div>"; need work.

Be sure that your JAVASCRIPT is in same PHP page wher you have your PHP code.