1

I am totally new to JavaScript or jQuery. Actually I am developing a web application under which I need to access some data in url format and I want to display a small popup window on mouseover event on this url and on occurrence of this event, url will pass three different php data IDs to javascript. Then small popup window will get some related data from mysql with the help of those passed IDs.

2 Answers 2

0

The answers to all of these questions are already here on SO. Break your problem down into smaller steps and you will find it:

Sign up to request clarification or add additional context in comments.

Comments

0

The easiest solution is to use ajax. Here is a sample implementation:

  1. The url link should contain the data you want to send to the server and would look like:

    <a href="yourURL" onclick="sendURL2Srvr(this);">link text</a>
  2. create a javascript section to receive the server response in a popup. This should roughly look like:

    <script>
      http = false;
    
      if (window.ActiveXObject) {
        http = new ActiveXObject("Microsoft.XMLHTTP");
      }
      else if (window.XMLHttpRequest ) {
        http = new XMLHttpRequest();
      }
      function sendURL2Srvr(elem) {
        http.abort();
        http.onreadystatechange=function() {
          var popupW=window.createPopup();
          if(http.readyState == 4) {
            if (http.status != 200)
              error('Something went wrong!');
            else
              popupW.innerHTML=http.responseText;
          }
        }
        http.open("GET", elem.href, true);
        http.send(null);        
      }
    </script>
    
  3. It is up to the server to dissect the received REQUEST and send the data back. This now becomes a pure php question.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.