|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
write i have a asp notice popup and i want to make it so <%
If strstatus = "on" Then %> <a href="javascript:notice('http://neil-1/address/notice/default.asp')"></a> <%Else End If %> but it dosent work it just shows the page nothing more but ihave all the connection code working for it but it just wont work and ive got thejava script popup code there iam not shur how to fix it? please help. |
|
#2
|
||||
|
||||
|
Hi
Can you post all your code including the notice() routine? MK |
|
#3
|
|||
|
|||
|
<script>
var newwindow; function notice(url) { newwindow=window.open(url,'name','height=260,width =290'); if (window.focus) {newwindow.focus()} } </script> <% Dim strConnection Dim objConnection Dim rstnotice strConnection = "Provider=SQLOLEDB;Data Source=;Database=address;Integrated Security=SSPI" Set objConnection = Server.CreateObject("ADODB.Connection") objConnection.Open strConnection Set rstnotice = objConnection.Execute("SELECT text, name, status FROM notice ") %> <% Do Until rstnotice.EOF Dim strtext strtext = rstnotice("text") If Len(strtext) > 0 then Do while Instr(1, strtext, "_") strtext = replace(strtext, "_", " ") Loop Else strtext = " " End If Dim strstatus strstatus = rstnotice("status") If Len(strstatus) > 0 then Do while Instr(1, strstatus, "_") strstatus = replace(status, "_", " ") Loop Else strstatus = " " End If Dim strname strname = rstnotice("name") If Len(strname) > 0 then Do while Instr(1, strname, "_") strname = replace(name, "_", " ") Loop Else strname = " " End If %> <% If strstatus = "on" Then %> <a href="javascript:notice('http://neil-1/address/notice/default.asp')"></a> <%Else End If %> |
|
#4
|
||||
|
||||
|
Hi
Change: Code:
<%
If strstatus = "on" Then %>
<a href="javascript:notice('http://neil-1/address/notice/default.asp')"></a>
<%Else
End If
%>
Code:
<%
If strstatus = "on" Then %>
<script language="JavaScript">notice('http://neil-1/address/notice/default.asp');</script>
<%Else
End If
%>
|
|
#5
|
|||
|
|||
|
no nothings happening?????
|
|
#6
|
||||
|
||||
|
Is strstatus definately equal to "on"? Add a Response.Write to check
MK |
|
#7
|
|||
|
|||
|
yes on the database table it is on
|
|
#8
|
||||
|
||||
|
Never mind what the database says it is. In your script, does Response.Write(strstatus) return "on"?
MK |
|
#9
|
||||
|
||||
|
This works:
Code:
<script>
var newwindow;
function notice(url)
{
newwindow=window.open(url,'name','height=260,width =290');
if (window.focus) {newwindow.focus()}
}
</script>
<script language="JavaScript">notice('pop1.html');</script>
MK |
|
#10
|
|||
|
|||
|
i get know errors at the boottom status bar!
|
|
#11
|
|||
|
|||
|
that code works but how do i make it work with the strstatus?
|
|
#12
|
||||
|
||||
|
Hi
Do you mean that Response.Write(strstatus) returns "on"? MK |
|
#13
|
|||
|
|||
|
no it does nothing
|
|
#14
|
||||
|
||||
|
There ya go then... You need to find out why, fix it and your notice() script will work
MK |
|
#15
|
||||
|
||||
|
What's this bit for?
Code:
strstatus = rstnotice("status")
If Len(strstatus) > 0 then
Do while Instr(1, strstatus, "_")
strstatus = replace(status, "_", " ")
loop
|
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Asp Help for notice popup |
| Thread Tools | Search this Thread |
![]() |