Robert Glavaš Robert Glavaš - 1 year ago 96
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>";

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download