Åbne i en anden frame
Hejsa jeg har nedstående kode, som er en del af en chat.Den virker som følgende:
Har 2 frames,
- mit message panel (nedstående kode)
- og min forside. Disse 2 vises samtidig.
Udover det, har jeg en anden som hedde chat_read.asp, hvor selve chatten vises.
Det der så skal er, når man skriver en besked og har trykket send, i mit messagepanel, skal min forside ramme (hovedramme) udskiftes med chat_read.asp
Hvordan gør jeg det ?
koden:
___________
<%
Dim C9tjatter, strToChatWith
C9tjatter = request.form(\"C9tjatter\")
strToChatWith = request.form(\"chatTxt\")
%>
<%
Const ForAppending = 8
dim strChatFileName, strPhysPath
strPhysPath = Server.MapPath(\"../../../db/chat.txt\")
strChatFileName = strPhysPath
dim objChatFileFSO
set objChatFileFSO = CreateObject(\"Scripting.FileSystemObject\")
dim objChatFileTS
if objChatFileFSO.FileExists(strChatFileName) then
\' Response.write strChatFileName
set objChatFileTS = objChatFileFSO.OpenTextFile(strChatFileName, ForAppending)
else
set objChatFileTS = objChatFileFSO.CreateTextFile(strChatFileName)
end if
sub WriteToChat (strNewEntry)
dim strChatEntry
strChatEntry = FormatDateTime(Now) & \" - \"
strChatEntry = strChatEntry & C9tjatter & \": \" & strNewEntry
objChatFileTS.WriteLine strChatEntry
end sub
sub CloseChat()
objChatFileTS.Close
end sub
%>
<%
if trim(strToChatWith) <> \"\" then
WriteToChat trim(strToChatWith)
CloseChat
end if
%>
<div align=\"right\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<FORM NAME=\"chatForm\" ACTION=\"chat_write.asp\" METHOD=\"POST\">
<tr>
<td>
<FONT FACE=\"Arial, Helvetica\">
<INPUT TYPE=\"TEXT\" NAME=\"chatTxt\" SIZE=\"99\" MAXLENGTH=\"60\">
</FONT>
</td>
<td>
<FONT SIZE=\"2\">
<INPUT TYPE=\"SUBMIT\" NAME=\"send\" VALUE=\"Indsend\">
</FONT>
</td>
<td width=\"20\"></td>
</tr>
<tr>
<td>
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr>
<td width=\"50%\"><font size=\"1\" face=\"Verdana\" color=\"#8EA6BF\">Copyright
2002 MsJubii.dk<br>
<b><u>Uofficiel</u> Jubii Chat side.</b></font></td>
<td width=\"50%\">
<p align=\"center\"><font size=\"2\" face=\"Verdana\" color=\"#B7C6D6\">Skift: <select size=\"1\" name=\"rum\" onchange=\"window.open(this.options[this.selectedIndex].value,\'_top\')\">
<option selected>MsJubii.dk</option>
<option value=\"../elevator.asp\">Elevator</option>
<option value=\"../chatfester/frame.asp\">Chatfester</option>
<option value=\"../chatklub/frame.asp\">Jubii Nation Chat Klub</option>
<option value=\"../profilmusik/frame.asp\">Profil Musik</option>
</select></font></p>
</td>
</tr>
</table>
</td>
<td><font size=\"2\" face=\"Verdana\" color=\"#B7C6D6\">Handling:
<select size=\"1\" name=\"D1\">
<option>$emote$</option>
<option>$emote$</option>
<option>$emote$</option>
<option>$emote$</option>
<option selected></option>
</select></font></td>
<td width=\"20\"></td>
</tr>
</FORM>
</table>
