Robert Glavaš Robert Glavaš - 4 months ago 40
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.