|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Detecting Pop-Up Stoppers
Is there a way to detect if a user has a pop-up stopper program installed?
Reason being, I currently have a program that detect if JavaScript is enabled, allowing me to reroute the user to the necessary page if it is/isn't. But if the browser has JavaScript turned on, but the user is using a pop-up stopper I get the following error, which causes my page to hang: "The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call did not execute." Any help is much appreciated. |
|
#2
|
|||
|
|||
|
I don't understand two things:
1. Why do you need to do this detecting in the first place? 2. how you can do this server-side that opens another window or redirects you to a location (what language are you writing this in?) I'm curious as to how you've done what you have, and how you might possibly handle all the different methods of stopping popups in the first place. |
|
#3
|
|||
|
|||
|
1) I need to detect the pop-up stopper's use because if it is active, it breaks my code, and causes my page to just hang. So I need a work around (if pop-up stopper = true, then do this, else do that).
2)My code is a mix of ASP and Javascript, I've pasted most of it below. Let me know if you have any other questions. Thanks! Code:
<html>
<head>
<title>Search is processing...</title>
<script language="javascript">
function openWindow1()
{
var ScreenWidth;
var ScreenHeight;
ScreenWidth = (window.screen.width/2) - (75 + 10);
ScreenHeight = (window.screen.height/2) - (100 + 50);
window.open("/results2.asp?UserRestriction=<%=UserRestrictionValue%>","","status=no, width=310,height=340,toolbar=NO,scrollbars=NO,resi zable=YES,left=" + ScreenWidth + ",top=" + ScreenHeight + ",screenX=" + ScreenWidth + ",screenY=" + ScreenHeight + "")
}
function openWindow2()
{
var ScreenWidth;
var ScreenHeight;
ScreenWidth = (window.screen.width/2) - (75 + 10);
ScreenHeight = (window.screen.height/2) - (100 + 50);
window.open("/results2.asp?UserRestriction=<%=UserRestrictionValue%>","","status=no, width=310,height=390,toolbar=NO,scrollbars=NO,resi zable=YES,left=" + ScreenWidth + ",top=" + ScreenHeight + ",screenX=" + ScreenWidth + ",screenY=" + ScreenHeight + "")
}
function openWindow3()
{
var ScreenWidth;
var ScreenHeight;
ScreenWidth = (window.screen.width/2) - (75 + 10);
ScreenHeight = (window.screen.height/2) - (100 + 50);
window.open("/results2.asp?UserRestriction=<%=UserRestrictionValue%>","","status=no, width=310,height=440,toolbar=NO,scrollbars=NO,resi zable=YES,left=" + ScreenWidth + ",top=" + ScreenHeight + ",screenX=" + ScreenWidth + ",screenY=" + ScreenHeight + "")
}
function relocateSearch()
{
window.location = "/query.idq?UserRestriction=<%=UserRestrictionValue%>&CiMaxRecordsPerPage=<%=CiMaxRecordsPerPage%>&CiScope=<%=CiScope%>&TemplateName=<%=TemplateName%>&CiSort=<%=CiSort%>&HTMLQueryForm=<%=HTMLQueryForm%>"
}
</script>
</head>
<body>
<%
'Create a recordset object
Set rsSearchResults = Server.CreateObject("ADODB.Recordset")
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT Count(tblWebsites.Title) FROM tblWebsites "
strSQL = strSQL & "INNER JOIN tblkeyword ON tblWebsites.SiteIDNo = tblkeyword.SiteID "
strSQL = strSQL & "WHERE (((tblkeyword.Keywords)='"& strSearchKeywords & "'));"
'Response.Write strSQL
on error resume next
Set objConn = Server.CreateObject ("ADODB.Connection") 'creates connection to DB
objConn.Mode = 3 'adoModeReadWrite
objConn.open Application("searchEngine")
set rstemp = objConn.Execute(strSQL)
'Call ErrorVBScriptReport("Select Statement")
'Call ErrorADOReport(strSQL, objConn)
Call ReRouteOnError
Select Case lcase(javascriptEnabled)
case "yes"
if (rstemp.eof or rstemp(0)=0) then
UserRestrictionValue = replace(UserRestrictionValue, "''", "'")
Response.Write "<script language=javascript>"
Response.Write "relocateSearch()"
Response.Write "</script>"
else
if rstemp(0) = 1 then
Response.Write "<script language=javascript>"
Response.Write "openWindow1(); "
Response.Write "relocateSearch()"
Response.Write "</script>"
else
if rstemp(0) = 2 then
Response.Write "<script language=javascript>"
Response.Write "openWindow2(); "
Response.Write "relocateSearch()"
Response.Write "</script>"
else
if rstemp(0) >= 3 then
Response.Write "<script language=javascript>"
Response.Write "openWindow3(); "
Response.Write "relocateSearch()"
Response.Write "</script>"
end if
end if
end if
end if
case "no"
response.redirect "/query.idq?UserRestriction="& UserRestrictionValue &"&CiMaxRecordsPerPage="& CiMaxRecordsPerPage &"&CiScope="& CiScope &"&TemplateName="& TemplateName &"&CiSort="& CiSort &"&HTMLQueryForm="& HTMLQueryForm &""
End Select
rstemp.close
set rstemp = nothing
objConn.Close
set objConn = nothing
%>
</body>
</html>
|
|
#4
|
|||
|
|||
|
pop up stopper users are usually aware of this . They know that their prog will break some legitimate site with legitimate popups. So u probably don't have to worry about those little things
__________________
Regards, James Yang .NET Developer / Network Engineer MCSE, MCDBA, MCSA, CCNA http://www.yellowpin.com/ http://www.opentechsupport.com/ |
|
#5
|
|||
|
|||
|
Pop Up Stoppers
I'm not seeing an answer in this thread. I, too, have a need to use pop-ups in an application I'm building (for launching page-contextual Help files) and am worried that Pop-Blockers will break this functionality.
Does anyone know if Pop-Up blockers stop user-initiated pop-ups? (ie: the user clicked on a link that spawns the new window)? Help is greatly appreciated. Rich |
|
#6
|
||||
|
||||
|
Usually, popup blockers only block non-user initiated windows - i.e. onload, onunload fire events.
|
|
#7
|
||||
|
||||
|
In opposition to stumpy's latest point, i've seen my spam detector detect stuff that isn't spam... but some Javascript popups do work... I agree with him about the onload/unload events...
Perhaps the best way to attack this problem is to simply be aware of the fact that it happens... A simple disclaimer mentioning that some functions on the site might not work if popups are disabled. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Detecting Pop-Up Stoppers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|