[ASP] JS / VBS troubles

Pagina: 1
Acties:

  • Skaah
  • Registratie: Juni 2001
  • Niet online
[ASP] JS / VBS troubles

ASP:
1
2
3
4
5
6
7
8
9
10
11
12
<% @LANGUAGE="JScript" %>
<%
function Quot(oInput)
{
  oOutput = oInput.replace(/'/g, "/'");    // '"
  oOutput = oOutput.replace('"','&quot;')  // '
  return oOutput;
}

 TextString = "Do's and Don'ts"
 Response.Write(Quot(TextString))
%>


Geeft als output:
Do/'s and Don/'ts
Maar
ASP:
1
2
3
4
5
6
7
8
9
10
11
12
<% @language="JScript" %>
<%
function Quot(oInput)
{
  oOutput = oInput.replace(/'/g, "/'");    // '"
  oOutput = oOutput.replace('"','&quot;')  // '
  return oOutput;
} 

 TextString = Request.QueryString('q') // <- zelfde tekst verder
 Response.Write(Quot(TextString))
%>


Geeft als output:
Runtime-fout Microsoft JScript (0x800A01B6)
Deze eigenschap of methode wordt niet ondersteund door dit object
Mis ik iets? Doe ik iets fout?

[ Voor 0% gewijzigd door Skaah op 18-11-2002 19:38 . Reden: ff verduidelijkt :) ]


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Kortom, de regel
code:
1
Response.Buffer = true;
geeft de bovenstaande foutmelding ?

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • Skaah
  • Registratie: Juni 2001
  • Niet online
drm schreef op 18 november 2002 @ 17:51:
Kortom, de regel
code:
1
Response.Buffer = true;
geeft de bovenstaande foutmelding ?
Nee, de foutmeldig komt door de .replace() opdracht.

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Hoogst waarschijnlijk moet je even checken of die TextString uiteindelijk wel een string object is. Waarschijnlijk dus, of die Request.QueryString () -calll wel goed gaat? Misschien krijg je wel een boolean (false) terug, welke aangeeft dat er iets mis ging, en probeer je nu de method 'replace' van een 'Boolean' object aan te spreken, en die bestaat niet...

hth :)

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz