pop up window ajax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • petvampire
    New Member
    • Jul 2009
    • 8

    pop up window ajax

    not sure if some one got a answer to this little issue. Im built a page that calls information from a page called database-update.asp and puts it in to the div tag Reload this. What i am trying to do is make a pop up so if some one clicks the link shown it open a pop up window. When trying to do this nothing happens. Any ideas how i can get a pop up window. I be Honest i do not understand ajax as im just using it as a refresh method to get new information every 5 seconds from a event log system im working on. Before some one points out im bypassing the users ablity to have a click noise, we had a refresh with a click and it annoyed all the programmers with it and was counter productive for other areas.

    here is my code

    Code:
    <style type="text/css">
    <!--
    .style1 {font-family: Arial, Helvetica, sans-serif}
    body {
    	margin: 0px 0px 0px 0px;
    	background-color: #FFFFFF;
    	}
    .style3 {
    	color: #FF0000;
    	font-weight: bold;
    	font-family: Arial, Helvetica, sans-serif;
    }
    -->
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
    <body>
    <script type="text/javascript">
    function Ajax(){
    var xmlHttp;
    	try{	
    		xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
    	}
    	catch (e){
    		try{
    			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
    		}
    		catch (e){
    		    try{
    				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    			}
    			catch (e){
    				alert("No AJAX!?");
    				return false;
    			}
    		}
    	}
    
    xmlHttp.onreadystatechange=function(){
    	if(xmlHttp.readyState==4){
    		document.getElementById('ReloadThis').innerHTML=xmlHttp.responseText;
    		setTimeout('Ajax()',10);
    	}
    }
    xmlHttp.open("GET","database-update.asp",true);
    xmlHttp.send(null);
    }
    
    window.onload=function(){
    	setTimeout('Ajax()',100);
    }
    </script>
    
    <div class="style1" id="ReloadThis"></div>
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    the only thing i could see is, that you don't call the service every 5s but after 100ms the first time and then 10ms later, when the response is ready. you may use the window.open() method to open a plain popup but currently you just set the innerHTML of you mentioned diff. i think i don't get the point quite well - where is a link and when do you want the popup?

    kind regards

    Comment

    Working...