JavaScript - Help Edit Code To Open In Iframe
Hi,
I am using a password protection javascript code that works very well, but my problem is that I would like to edit the code so that the ".html" page will open inside an iframe on the main page. I think the code "window.location=verification+extension" needs to be edit to indicate the iframe that I want the html page to open in. The complete code is below in bold and parts of code in red text is where I think I need to edit, but I don't know how to edit the code to do what I want. Can anyone please Help Me, Thanks to all that respond. <!-- var pass=new Array() var t3="" var lim=7 pass[0]="TLMXe8VqAwsAllw" pass[1]="YeWAc9pfP1rmGrA" pass[2]="M8ljslaPqg0mQQp" pass[3]="SRdDwXWa0LSsGB" pass[4]="83I2WyO06m3aUjs0" pass[5]="453I2WyO06m3aUjs" var extension=".html" var enablelocking=0 var numletter="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" var temp3='' var cur=0 function max(which){ return (pass[Math.ceil(which)+(3&15)].substring(0,1)) } function testit(input){ temp=numletter.indexOf(input) var temp2=temp^parseInt(pass[phase1-1+(1|3)].substring(0,2)) temp2=numletter.substring(temp2,temp2+1) return (temp2) } function submitentry(){ t3='' verification=document.password1.password2.value phase1=Math.ceil(Math.random())-6+(2<<2) var indicate=true for (i=(1&2);i<window.max(Math.LOG10E);i++) t3+=testit(verification.charAt(i)) for (i=(1&2);i<lim;i++){ if (t3.charAt(i)!=pass[phase1+Math.round(Math.sin(Math.PI/2)-1)].charAt(i)) indicate=false }0 if (verification.length!=window.max(Math.LOG10E)) indicate=false if (indicate) window.location=verification+extension else alert("Invalid password. Please try again") } //--> Similar TutorialsGood day all I have a contact form that opens up in a iframe on my home page. I have a second page with a link for contact and I would like to know If their is a javascript that when I press the contact link on the second page that it can go to the home page and open the iframe for the cntact form. Please note I do not know javascript I am trying to learn it. Thank you Shoutout I am creating chat application.I have friend list with whom login user can chat.onclick of user name i want to open different div in which i can load my chat page.Can anyone suggest me javascript for this task.
I have a PARENT HTML page. Within it, there is an iFrame. Let us call page inside of iFrame is CHILD. I would like to following things: 1. When click button in CHILD, A NEW full size page opens and mouse focus moves to NEW. I used following scripts: function openFullWin(urlPara) { var windowFeatures = 'menubar=1,modal=0,resizable=1,scrollbars=1,status=1,toolbar=1,width=' + screen.availWidth + ',height=' + screen.availHeight + ',left=0,top=0'; var winNew = window.open(urlPara, '', windowFeatures); winNew.focus(); this.blur(); } In Firefox, if only PARENT widow there. It works property. However, if there is another window there, the focus moved to that window rather than the NEW. In IE, if there is another window there, the NEW open as a tab in that window, rather than as tab in PARENT. 2. When click button in CHILD, A NEW full size page opens and mouse focus moves to NEW. At meantime, the CHILD changes to a NEWCHILD page, but not on focus. I am never being able to do this. Please help. 3. When click button in CHILD, A NEW full size page opens to replace PARENT. Of course, the CHILD disappeared too. I am never being able to do this. Please help. Hello folks! I don't know anything about JavaScript but I found a really cool snippet I use a lot. It will randomize images and each image can open a new link. It looks like this: ---------------------------------------------------- <script language="JavaScript" type="text/javascript"> function random_imglink(){ var myimages=new Array() myimages[1]="/img/images1.jpg" myimages[2]="/img/images2.jpg" myimages[3]="/img/images3.jpg" var imagelinks=new Array() imagelinks[1]="http://www.google.com" imagelinks[2]="http://www.yahoo.com" imagelinks[3]="http://www.alexa.com" var ry=Math.floor(Math.random()*myimages.length) if (ry==0) ry=1 document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>') } random_imglink() //--> </script> ------------------------------------------------- Now, my question is, can I link to open a document within an iFrame on my page? Please don't tell me not to use iframes or whatever, I'm not a professional, just want to see if this works. Hi all. First post so please be gentle. My sites has a menu on the home page linking to a dozen other pages. My intention is to open those items into a main iframe also on the home page. I have put the <base target="iframe" > in the <Head> area and all seems to work in Opera but Internet Explorer and Firefox will both open new windows instead of loading into the iframe. Having said that. Links from WITHIN the iframe will open correctly in all browsers. Ideas in newbie-speak very much appreciated Regards, Phil I have two pages A and B. I have a link in the page A. I have two iframes in the page B. In practice, the link in the page A must open the page B and the link's href must open in the second iframe of the page B. Is there any script that does this? This website details how to make a gallery with javascript. http://monc.se/kitchen/80/lightweigh...ith-thumbnails My problem here is that instead of a cropped image in the thumbnails, I would like a re sized image. This is the CSS and javascript code.
Code: /* begin gallery styling */ #jgal { list-style: none; width: 200px; } #jgal li { opacity: .5; float: left; display: block; width: 60px; height: 60px; background-position: 50% 50%; cursor: pointer; border: 3px solid #fff; outline: 1px solid #ddd; margin-right: 14px; margin-bottom: 14px; } #jgal li img { position: absolute; top: 20px; left: 220px; display: none; } #jgal li.active img { display: block; } #jgal li.active, #jgal li:hover { outline-color: #bbb; opacity: .99 /* safari bug */ } Code: <script type="text/javascript">document.write("<style type='text/css'> #gallery { display: none; } </style>");</script> <!--[if lt IE 6]><style media="screen,projection" type="text/css">#gallery { display: block; }</style><![endif]--> <script type="text/javascript"> var gal = { init : function() { if (!document.getElementById || !document.createElement || !document.appendChild) return false; if (document.getElementById('gallery')) document.getElementById('gallery').id = 'jgal'; var li = document.getElementById('jgal').getElementsByTagName('li'); li[0].className = 'active'; for (i=0; i<li.length; i++) { li[i].style.backgroundImage = 'url(' + li[i].getElementsByTagName('img')[0].src + ')'; li[i].style.backgroundRepeat = 'no-repeat'; li[i].title = li[i].getElementsByTagName('img')[0].alt; gal.addEvent(li[i],'click',function() { var im = document.getElementById('jgal').getElementsByTagName('li'); for (j=0; j<im.length; j++) { im[j].className = ''; } this.className = 'active'; }); } }, addEvent : function(obj, type, fn) { if (obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } obj.attachEvent("on"+type, obj[type+fn]); } } } gal.addEvent(window,'load', function() { gal.init(); }); </script> Thanks. I have a website that is using ajax to keep the page up to date with the database information. I call this page through a file called start.php. Once index.php is loaded it has a menu with selections. I then want it to call a page called query.php in an iframe to update the information, but not open a new window. In the iframe the query.php will run and then redirect itself to blank.php. The code is as follows and any help would be much appreciated. I have tried several methods of doing this and they have been commented out because they didn't work or didn't do what I wanted them to do. I do not want to use window.open since IE doesn't work well with it. window.open does work by pop up windows but I want to stay away from them. The main code I am looking to get help on is in red under start.php. In start.php I will include the entire file. In index.php I'm only going to include the main sections I use for this snippit. In query.php I'm not going to include query.php since I beleive this file isn't important for this snippit. start.php Code: <html> <head> <title>Countries At War!</title> <body style="background-color:#B0C4DE;"> <script language="JavaScript" type="text/javascript"> //Gets the browser specific XmlHttpRequest Object function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); //Not IE } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); //IE } else { //Display your error message here. //and inform the user they might want to upgrade //their browser. alert("Your browser doesn't support the XmlHttpRequest object. Better upgrade to Firefox."); } } //Get our browser specific XmlHttpRequest object. var receiveReq = getXmlHttpRequestObject(); //Initiate the asyncronous request function sayHello() { //If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call. if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { //Setup the connection as a GET call to SayHello.html. //True explicity sets the request to asyncronous (default). receiveReq.open("GET", 'index.php', true); //Set the function that will be called when the XmlHttpRequest objects state changes. receiveReq.onreadystatechange = handleSayHello; //Make the actual request. receiveReq.send(null); } } //Called every time our XmlHttpRequest objects state changes. function handleSayHello() { //Check to see if the XmlHttpRequests state is finished. if (receiveReq.readyState == 4) { //Set the contents of our span element to the result of the asyncronous call. document.getElementById('span_result').innerHTML = receiveReq.responseText; } } function openMenu(query) { var myString = 'query.php?' + query; // window.open(myString, 'linkname', 'title=no, height=465, width=400, left=550, top=150, location=yes, resizable=no, menubar=no, scrollbars=no') //document.getElementById('engine').src = myString; //document.getElementById('engine').setAttribute('src',myString;); //top.frames['engine'].location.href = myString; pausecomp(1000); sayHello(); } function pausecomp(millis) { var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millis); } </script> </head> <body> <a href="javascript:sayHello();">Say Hello</a><br /> <iframe src="blank.php" MarginWidth="0" transparent="yes" width="30" height="25" frameborder="0" scrolling="no" name="engine"> UPGRADE YOUR BROWSER</iframe> <span id="span_result"></span> <body onLoad="sayHello();"> </body> </html> index.php Code: <table width="100%" border="2" bordercolor="Black"> <tr><center> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=1');">Home</a></td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=2');">Jobs</td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=3');">Travel</td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=4');">Fight</td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=5');">Inventory</td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=6');">Properties</td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=7');">Rewards<?php if($db_field['rewardpoints'] >= "1") print "(". $db_field['rewardpoints'] . ")";?></td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=8');">Profile<?php if($db_field['profilepoints'] >= "1") print "(". $db_field['profilepoints'] . ")";?></td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=9');">Alliances</td> <td><center><a href="javascript:void(0);" onclick="javascript: openMenu('menulevel1=10');">Options</td> </tr></center> </table> Thanks in advance for all the help. Hello all kind people I have this scroll to top code, but to edit it need some help. the problem is that I will not see this eksamplen the page evry time, would like to reach all the way down on the side to be displayed. Thanx for all comment and help Here is Scroll to Top code: <script type="text/javascript"> $(document).ready(function() { $('.top').addClass('hidden'); $.waypoints.settings.scrollThrottle = 30; $('#wrapper').waypoint(function(event, direction) { $('.top').toggleClass('hidden', direction === "up"); }, { offset: '-100%' }).find('#main-nav-holder').waypoint(function(event, direction) { $(this).parent().toggleClass('sticky', direction === "down"); event.stopPropagation(); }); }); </script> Hello, I have found this JS code that makes a window popunder on the first click when someone clicks anywhere on the page. This code seems to bypass any inbuilt browser pop up blockers. Code: // JavaScript Document var stagedPopFrequency = "1 days"; var stagedCookieName = "__name"; if (!document.currentStage) document.currentStage = 0; document.currentStage++; if (document.currentStage == 1) { function stagedGetCookie(Name) { var search = Name + "="; var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { // if cookie exists offset += search.length; // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue = unescape(document.cookie.substring(offset, end)); } } return returnvalue; } function stagedSetCookie(Name, Value, Expire) { if (Expire != null) { var expireDate = new Date(); expireDate.setDate(expireDate.getDate() + parseInt(Expire)); document.cookie = Name+"="+Value+";path=/;expires=" + expireDate.toGMTString(); } else { document.cookie = Name+"="+Value+";path=/"; } } function stagedResetCookie(Name) { var expireDate = new Date(); expireDate.setDate(expireDate.getDate() - 10); document.cookie = Name+"=;path=/;expires=" + expireDate.toGMTString(); } function stagedPopUnder() { if (stagedGetCookie(stagedCookieName) == '') { var thisStage = 1; var stageFunc = eval('window.popUnderStage'+thisStage); if (stageFunc != undefined) { stageFunc(); stagedSetCookie(stagedCookieName, thisStage + 1, stagedPopFrequency); } } else { var thisStage = parseInt(stagedGetCookie(stagedCookieName)); var stageFunc = eval('window.popUnderStage'+thisStage); if (stageFunc != undefined) { stageFunc(); stagedSetCookie(stagedCookieName, thisStage + 1, stagedPopFrequency); } } } function stagedAttachBody() { if (document.body) { if (document.all) { document.body.attachEvent('onclick', stagedPopUnder); } else { document.body.addEventListener('click', stagedPopUnder, false); } } else { setTimeout('stagedAttachBody()', 200); } } stagedAttachBody(); } if( parseInt(navigator.appVersion) > 3 ) { winWidth = screen.availWidth; winHeight = screen.availHeight; } else { winWidth = "1024"; winHeight = "768"; } var stagedTmpFunc = function() { var pu = window.open("http://www.domain.com", "_blank", "width=" + winWidth + ",height=" + winHeight + ",scrollbars=1,resizable=1,menubar=1"); pu.blur(); window.focus(); } eval('window.popUnderStage'+document.currentStage+' = stagedTmpFunc;'); stagedTmpFunc = null; This will work across IE, FF and Chrome. What im trying to do is get this code to pop 2 windows on the first click. Ive tried calling this script twice in the html but this causes one window to pop on the first click and another on the second. Ive tried to do this: Code: var stagedTmpFunc = function() { var pu = window.open("http://www.domain1.com", "_blank", "width=" + winWidth + ",height=" + winHeight + ",scrollbars=1,resizable=1,menubar=1"); pu.blur(); window.focus(); var pu = window.open("http://www.domain2.com", "_blank", "width=" + winWidth + ",height=" + winHeight + ",scrollbars=1,resizable=1,menubar=1"); pu.blur(); window.focus(); } But this causes IE to keep popping the windows on every single click, I tried another variation, I numbered the second window "var pu2" or something like that, I cant quite remember. But this still did not work. It just caused errors. If this code cannot be edited to pop 2 windows on the first click, does anyone have another code which can and still bypass the pop up blockers built into browsers? Thanks just started learning scripting. This bookmarklet essentially takes the domain name of the tab currently open when one pressses it & runs a search query through Google prefixing the related: search operator. As evident, here it shows the result in the same page replacing the earlier one. I would like it to open in a new tab. Can you please tell me how to do so. Self-learning it. At an initial stage of learning, I am. Code: javascript:location.href='https://www.google.com/search?q=related%3A'+encodeURIComponent(location.host) Hi everyone I am a newbie with respect to programming and this is my first post I have a small problem, probably very basic to everyone except me, and would appreciate and value your advice I have entered below a javascript I am using on my website. This script is designed to automatically insert videos based on keywords and works perfectly except that my visitors are taken away from my website when they use it. Can someone please tell me what code to insert, and where, in order get the script to open in a new page. I am aware how to do this in html using target ="blank" but do not know how to do it in javascript. Thankyou in anticipation, the code I am using is below: Code: <!-- BEGIN HostDomain --> <div id="HostDomain_DivId"> </div> <script src="http://app.HostDomain.com/script/HostDomainUtils.js"> </script> <script language="JavaScript" type="text/javascript" src="http://app.HostDomain.com/script/widgetTy pe/carousel/ptContentflow.js" load="fancyScrollbar"> </script> <script type="text/javascript"> /* Do not change the values given below. */ var HostDomain_Organization_Name = "MySite"; var HostDomain_Organization_ID = "xxxxxxxx"; var HostDomain_Feed_ID = "xxxxxxx"; var HostDomain_DivId = "HostDomain_DivId"; var HostDomain_AppServerPath = "http://app.HostDomain.com"; </script> <script src="http://app.HostDomain.com/script/HostDoma in.js"> </script> <!-- END HostDomain --></font></td> Hi My website was recently ftp hacked and a file inserted into it - js.php - which seems to be some sort of advertising spam programme. Having spotted the file I have renamed it to hide it but lots of other sites are still referring into my site looking for this php file. What I would like to do is to *just* open a java alert box on the referring sites to alert the users that the site has been hacked and that they should notify the webmaster so that he can fix his site. The line referring into my site is - <script type="text/javascript" src="http://www.mysite.com/js.php"></script> Is this something simple to do? I know nothing about Java or PHP so need detailed help. Thanks John I have the code below that gives the ability to open and collapse sections. I don't know too much javascript and found this code online. I tweaked it to serve my purposes but it doesn't do one thing. I would like all of the areas to be collapsed when the page is opened. How would I tweak the code below to do that? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Untitled Page</title> <script type="text/javascript"> function ExpandCollapseTable1(titleRow) { if(titleRow.parentNode.childNodes.length > 1) { if(titleRow.parentNode.childNodes[1].style.display=="block" || titleRow.parentNode.childNodes[1].style.display=="") { for(var i=1;i<titleRow.parentNode.childNodes.length;i++) { titleRow.parentNode.childNodes[i].style.display = "none"; } } else { for(var i=1;i<titleRow.parentNode.childNodes.length;i++) { titleRow.parentNode.childNodes[i].style.display = "block"; } } } } function ExpandCollapseTable2(titleRow) { if(titleRow.parentNode.childNodes.length > 1) { if(titleRow.parentNode.childNodes[1].style.display=="block" || titleRow.parentNode.childNodes[1].style.display=="") { for(var i=1;i<titleRow.parentNode.childNodes.length;i++) { titleRow.parentNode.childNodes[i].style.display = "none"; } } else { for(var i=1;i<titleRow.parentNode.childNodes.length;i++) { titleRow.parentNode.childNodes[i].style.display = "block"; } } } } function ExpandCollapseTable3(titleRow) { if(titleRow.parentNode.childNodes.length > 1) { if(titleRow.parentNode.childNodes[1].style.display=="block" || titleRow.parentNode.childNodes[1].style.display=="") { for(var i=1;i<titleRow.parentNode.childNodes.length;i++) { titleRow.parentNode.childNodes[i].style.display = "none"; } } else { for(var i=1;i<titleRow.parentNode.childNodes.length;i++) { titleRow.parentNode.childNodes[i].style.display = "block"; } } } } function ExpandCollapseTable4(titleRow) { if(titleRow.parentNode.childNodes.length > 1) { if(titleRow.parentNode.childNodes[1].style.display=="block" || titleRow.parentNode.childNodes[1].style.display=="") { for(var i=1;i<titleRow.parentNode.childNodes.length;i++) { titleRow.parentNode.childNodes[i].style.display = "none"; } } else { for(var i=1;i<titleRow.parentNode.childNodes.length;i++) { titleRow.parentNode.childNodes[i].style.display = "block"; } } } } </script> </head> <body> <table border='0' bordercolor='#000000' width='100%' cellspacing='0' cellpadding='0' bgcolor=red> <tr onclick="ExpandCollapseTable1(this);" style='cursor:pointer;'> <td> I</td> </tr> <tr> <td><table border='0' bordercolor='#000000' width='100%' cellspacing='0' cellpadding='0' bgcolor=lightgreen> <tr onclick="ExpandCollapseTable2(this);" style='cursor:pointer;'> <td> A</td> </tr> <tr> <td><table border='0' bordercolor='#000000' width='100%' cellspacing='0' cellpadding='0' bgcolor=yellow> <tr onclick="ExpandCollapseTable3(this);" style='cursor:pointer;'> <td> i</td> </tr> <tr> <td><table border='0' bordercolor='#000000' width='100%' cellspacing='0' cellpadding='0' bgcolor=lightblue> <tr onclick="ExpandCollapseTable4(this);" style='cursor:pointer;'> <td> a</td> </tr> <tr> <td bgcolor=orange> CONTENT CONTENT CONTENT</td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table> </body> </html> FYI, I've also posted this question at: http://www.tek-tips.com/submitpost.cfm?pid=216 http://www.webdeveloper.com/forum/sh...60#post1106660 Hello all,I have a website and I would like a pop-up window to promote a new website venture I have. I would like for the new website to open in a completely new window/browser when my members simply click on the index page (No link or Buttons).The code below does most of what I ask lol,but it.. 1.Only opens in a new tab (in same browser) while I would like for it to open in a completely new browser "full page" menu bar scroll tab and all. plus 2.It seems to open each and every time the page is clicked,which will be annoying to my members.I would only like for it to open 1 time per visitor every 24 hours or whenever cookies are cleared. Code: <html> <head> <script type="text/javascript"> function click_on() { window.open("URL HERE", "_blank"); } </script> </head> <body onclick="click_on()"> </body> </html> I am no expert at this,and my knowledge is very limited,so excuse me if this is a simple situation.Any help would be greatly appreciated. Thanks, Roco Hi. I need help in adding a parenthesis in the area code of the phone number and validating it also. I made some javascript code but it is not working. Can somebody please help? I just need the code in adding () in the area code. For example: When user enter 10 digit number no spaces or dashes such as 0000000000 or 000-000-0000, I would like to have this format right away (000)000-0000. I know how to replace the characters but adding it is a tricky one for me. Can somebody please help? Thanks. I tried to rework a short script to pull info from an iframe instead of the basic page it's sitting on, and I got confused. It's not working. Here's what I've got: Code: <script type="text/javascript" language="JavaScript"> function find_div_class() { var divCollection = document.getElementById('iframeId'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; for (var i=0; i<divCollection.length; i++) { if(innerDoc[i].getAttribute("class") == "list-journal-entry-wrapper") { findMeText = divCollection[i].innerHTML; alert(findMeText); } } } </script> Press the button to find the divs with class "iframeId".<br /> <input type="button" onfocus="this.blur()" value="iframeId" onclick="javascript:find_div_class();return false;""/> I tried another way too, but still nothing: Code: <script type="text/javascript" language="JavaScript"> function find_div_class() { var divCollection = document.getElementById('iframeId'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; var info = document.getElementById("list-journal-entry-wrapper"); alert(list-journal-entry-wrapper); } } } </script> Hi, I have a webpage structured as below and want the contents in the iframe to load prior to the code below it. At the moment the javascript(resizing stuff) in the iframe code delays the iframe from loading in full before the "streaming music player" code. This iframe javascript is on the page as opposed to an external file. I would have thought the iframe would have to load in full before the code below it would be executed. How do I make the iframe load in sequence or delay/hide the code below it until iframe is fully loaded? Thanks ####header#### flash ####header menu#### flash ####iframe#### lots of javascript and content from page on mywebsite (not external url) ###streaming music player##### embedded flash player linked to external site ####footer menu#### flash I'm facing an issue with fetching the page URL from an IFRAME with cross domain. Is there any approach/ any ways to achieve this? Hi, I want to restrict opening my popup window if it is already opened. For simple scenario, it is quite possible to do but in my case -- 1) When parent page is opening popup window, it is getting refreshed (required from client for some reason). 2) Once submit button is clicked from popup window, again parent page is getting refreshed (again its a requirement from client side). With these 2 conditions, I lost my saved value from variable and hence new popup is keep coming when the action is same. Currently I am using below code to open popup [CODE] function OpenWindow() { if(winPop && !winPop.closed) { alert("Popup is already open"); } else { winPop = window.open('MyPopupPage.aspx'); } } [CODE] Please help me to get rid of this problem. Thanks in advance. - Bhasker |