SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamic jQuery Tooltip using PHP -- FF works/IE broke

    Normally the jQuery tooltip has you create multiple static files to display the text you want to have in a tooltip. I figured I could just use one php file that has a $_GET request and I can dynamically print any message on the fly.

    I have it working in FireFox, but it is not displaying the echo $_GET information in Internet Explorer. Why not?

    index.php calls this with $msg in the URL:
    Code HTML4Strict:
    This is a <a href='_tooltip.php?msg=Hello World!&width=300' name='Tooltip Test' id='dynamictip' class='jTip'>tooltip</a>

    _tooltip.php acts as a container to echo the $_GET information:
    Code HTML4Strict:
    <div align="left"><?php echo $_GET['msg']; ?></div>

    Preview:
    http://www.psylicyde.com/_old/tooltip/

    Source Files
    http://www.psylicyde.com/_old/tooltip/tooltip.zip

    Why wont this work in Internet Explorer?

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Try URL encoding your message; what you're producing isn't a valid URL (URLs can't contain spaces), but I don't know if that's the actual cause of your problem.

    Code HTML4Strict:
    This is a <a href='_tooltip.php?msg=Hello%20World!&width=300' name='Tooltip Test' id='dynamictip' class='jTip'>tooltip</a>

    If your tooltips are just simple text, you should probably just throw that text in the title attribute of the anchor, and modify your JavaScript to display that directly instead of making a pointless XMLHttpRequest.

  3. #3
    SitePoint Guru ripcurlksm's Avatar
    Join Date
    Aug 2004
    Location
    San Clemente, CA
    Posts
    859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hot dog! that worked --

    Could I put CDATA in there?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •