Jump to content

On hover pop up calling a PHP script (New to AJAX/JQuery)


tidalik

Recommended Posts

Hi all, I have a dynamic list that is refreshed regularly from the server using AJAX.  When one of the listed items is in use, I highlight it and have an "In use" tag added.

 

I'd like to be able hover over the "In use" tag and get details of the usage.  I have written the php script that outputs the details of a usage when passed an ID, now I want to get the hover pop working.

 

I've searched google a bit over the last couple of days but keep finding tutorials that use divs for the content (which doesn't work so well as I am already loading the list into a div).

 

I'd appreciate some pointers :)

 

Code currently in use:

index.php

<script>
$(document).ready(function() {
	 $("#list").load("current.php");
   var refreshId = setInterval(function() {
      $("#list").load('current.php');
   }, 3000);
   $.ajaxSetup({ cache: false });
});
</script>
<!------Snip---------------->
<h3>Current Usage</h3>
<div id="list">
</div>

 

current.php outputs a html table ie:

<table id="registrations">
<tr><td>Number</td><td>In Use</td></tr><tr class="inuse"><td>5001</td><td><a href="../detaileduse.php?ref=5001" class="onhover" target=new>Yes</a></td></tr>
<tr><td>5002</td><td></td></tr>
</table>

 

At present the link I've set up in the "In Use" doesn't work, but does if I choose to open in new window or tab.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.