Jump to content

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


tidalik
Go to solution Solved by spiderwell,

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.