jQuery passing parameters with .load

Fill a div with data returned from a jQuery POST.  An alert on the client side displays the arriving data.

Who is calling.  This data is being passed via POST.

<body><div class="spec" id="spec" ></div></body>
<script>$("#spec").load("generic.php", {link:"12345679"});</script>

Who is called: (generic.php)

 function GetXParameter()
  $path = $_POST['link'];
  return urldecode($path);

 $p = GetXParameter();

 <head><script src="../../js/jquery-3.3.1.min.js"></script></head>
  <div id='caption'>This is the shit. '<? echo $p; ?>'</div>
   $(document).ready(function ()
   {  alert ('link = ' + '<? echo $p; ?>');  });

Leave a Reply