SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    about a pop-up window with texts in it

    In continue of this topic:
    http://www.sitepoint.com/forums/show...=711160&page=3

    I got a table in the db with the following records: storyID and description
    i want it to work so when some1 click on the "read" link it'll open a window in the center of the page with texts in it.

    So far i've started in this way:

    Stories.ASP in the HEAD tag, function to hide the DIV and another function to get the selected story ID

    Code:
    <script type="text/javascript">
    window.onload = function (hide) {
      document.getElementById('stories').style.visibility='hidden';
    }
    function morephotos (storyID) {
    	var xmlHttp;
    	var resp = 'CLOSE';
    	try {
    		xmlHttp = new XMLHttpRequest();
    	}
    	catch (e) {
    		try {
    			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    		}
    		catch (e) {
    			try {
    				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    			}
    			catch (e) {
    				alert ('Your browser does not handle the photo selection process');
    				return false;
    			}
    		}
    	}
    	xmlHttp.onreadystatechange = function() {
    		if (xmlHttp.readyState == 4) {
    			resp = xmlHttp.responseText;
    			if (resp == 'ERROR') {
    				alert ('There was a problem getting the photos.');
    			} else {
    				el = document.getElementById('photos');
    				el..innerHTML = resp;
    				el.style.visibility = 'visible';
    		}
    	}
    	var photos = 'getstories.asp?storyID=' + storyID;
    
    	xmlHttp.open ("GET",data,true);
    	xmlHttp.send (null);
    }
    </script>
    in the BODY tag
    Code:
    <div id="stories"></div>
    ...
    <span onclick="morephotos('<%=table1(0,iCounter)%>')">Read</span>
    what do i need to do next? what should the GetStories.asp contain...

    thanks for the help

  2. #2
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ulthane View Post
    what should the GetStories.asp contain...
    from
    Code:
     
     
    var photos = 'getstories.asp?storyID=' + storyID;
    getstories.asp needs to contain the code to retrieve the data from the database for storyID and then return it to your ajax object.


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
  •