473,804 Members | 3,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pop up window ajax

8 New Member
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

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2. <!--
  3. .style1 {font-family: Arial, Helvetica, sans-serif}
  4. body {
  5.     margin: 0px 0px 0px 0px;
  6.     background-color: #FFFFFF;
  7.     }
  8. .style3 {
  9.     color: #FF0000;
  10.     font-weight: bold;
  11.     font-family: Arial, Helvetica, sans-serif;
  12. }
  13. -->
  14. </style>
  15. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
  16. <body>
  17. <script type="text/javascript">
  18. function Ajax(){
  19. var xmlHttp;
  20.     try{    
  21.         xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
  22.     }
  23.     catch (e){
  24.         try{
  25.             xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
  26.         }
  27.         catch (e){
  28.             try{
  29.                 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  30.             }
  31.             catch (e){
  32.                 alert("No AJAX!?");
  33.                 return false;
  34.             }
  35.         }
  36.     }
  37.  
  38. xmlHttp.onreadystatechange=function(){
  39.     if(xmlHttp.readyState==4){
  40.         document.getElementById('ReloadThis').innerHTML=xmlHttp.responseText;
  41.         setTimeout('Ajax()',10);
  42.     }
  43. }
  44. xmlHttp.open("GET","database-update.asp",true);
  45. xmlHttp.send(null);
  46. }
  47.  
  48. window.onload=function(){
  49.     setTimeout('Ajax()',100);
  50. }
  51. </script>
  52.  
  53. <div class="style1" id="ReloadThis"></div>
  54.  
Jul 25 '09 #1
1 2768
gits
5,390 Recognized Expert Moderator Expert
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
Jul 27 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
1846
by: Charlie Garrett-Jones | last post by:
i have a server side generated web application that provides parameter forms and always opens the associated reports in a new browser window. the code that controls the opening of the new browser window is simply html target='_blank'. but now there is some business rules that may be checked server side only. so if the data provided fails, i want the same target window as the parameter form and if it passes i want a new window. can anyone...
35
2318
by: eyoung | last post by:
I call a function that takes the unit price and quantity ordered to create an amount...it looks something like this. function calculateCost() { quantity=document.RFO.quantity.value; unitPrice=document.RFO.unitPrice.value; total=0; if(isPositiveInteger(quantity)) {
5
13932
by: Sommer.pde | last post by:
It took me some time to find out when and why this happens. When the window of Internet Explorer is closed with an AJAX call still pending, something funny happens. Do it twice, and you will have to restart the browser. Here a little sample: http://truefriendz.de/iedos The script on this site will open 5 test-windows one at a time.
5
6163
by: steve.chambers | last post by:
I'm sure this q must have been asked before but I'm really struggling to find the answer anywhere so have finally given up and will consult the usenet community - hopefully there's someone out there who's seen it all before and can help me out! I have a webpage which needs to make some function calls after the page has loaded - won't go into details surfice to say here is a code fragment: function addLoadEvent(func) { var oldonload =...
0
1154
by: ajittondwalkar | last post by:
i am developing a application in asp.net with vb and ajax implemented. in this application i want to open a report into new window. i had given in print button click event page.clientscript.registerstartupscript(page.gettype, "showreport", "window.open("showreport.aspx")") this command is not working if i implements ajax into the page. if i remove the ajax code (i.e. scriptmanager and updatepanel) the it works fine. but i want to open...
3
1701
by: jaynick | last post by:
Hello, everyone! I'm hoping that someone in this forum will be kind enough to help me out. I am having a Javascript issue related to Ajax and I just can't seem to figure it out. I am currently using the following Javascript code for Ajax purposes and it works perfectly: <script language = "javascript"> var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); } else if...
4
1810
by: sheldonlg | last post by:
Does anyone know how to open a window and have it close by itself? You may ask why, but here it is. I want to have it open (a php script), run that script, and then close itself. I have an application that is a huge AJAX framework app. There appears to be some interaction between that and the mail sending software I have. I want to send email with a file attached. The software I am using for that is htmlMimeMail5 (php5). Since I...
2
1405
by: EnjoyNews | last post by:
Hi I have made a very simple JavaAjax like this: <div class="iconbox" onmouseover="InProcess('my text', 'inprocess', 'In Process');"></div> <div id=inprocess"></div> and it opens a small windows with the 'my text' in it, in a div below the icon.
6
2074
by: SAL | last post by:
Hi, VS2005 post I'm opening a window using the following syntax: Protected Sub lbEstValue_Click(ByVal sender As Object, ByVal e As System.EventArgs) Response.Write("<script>window.open('EstValueHelp.aspx','_help', 'width=400,height=400');</script>") End Sub
0
9710
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9589
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10593
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.