[thelist] Didya Know??

Anthony Baratta Anthony at Baratta.com
Tue Jul 3 13:07:06 CDT 2001


(OK - show'd my ignorance on the last Didya know....but gonna stick my neck 
out anyway with this one. ;-)

I'm running II5 and found a weird quirk with ASP. When I write functions, I 
normally wrap the ASP functions in the following tag:

[SCRIPT LANGUAGE="vbscript" RUNAT="server"]

.... blah blah blah ....

[/SCRIPT]

No reason other than that's how a book did it when I was starting to learn 
ASP. So the other day I'm enhancing a function that throws HTML to the 
screen and the ASP page broke.

original (working) function:

[SCRIPT LANGUAGE="vbscript" RUNAT="server"]

.... blah blah blah ....

function ButtonWidget()
	subHTML = ".... blah blah blah ...."
	subHTML = subHTML & ".... blah blah blah ...."
	ButtonWidget = subHTML
end function

.... blah blah blah ....

[/SCRIPT]

The new and improved widget needed to have some javascript added to the 
HTML. So I added the javascript tags to the string like so.

[SCRIPT LANGUAGE="vbscript" RUNAT="server"]

.... blah blah blah ....

function ButtonWidget()
	subHTML = ".... blah blah blah ...."
	subHTML = subHTML & "[script language=""javascript""]"
	subHTML = subHTML & ".... blah blah blah ....[/script]"
	subHTML = subHTML & ".... blah blah blah ...."
	ButtonWidget = subHTML
end function

.... blah blah blah ....

[/SCRIPT]

The compile of the page by the ASP engine broke on the new lines saying 
that I had nested script tags!! If I removed the framing script tags with 
the % tags, all worked fine.

[%

.... blah blah blah ....

function ButtonWidget()
	subHTML = ".... blah blah blah ...."
	subHTML = subHTML & "[script language=""javascript""]"
	subHTML = subHTML & ".... blah blah blah ....[/script]"
	subHTML = subHTML & ".... blah blah blah ...."
	ButtonWidget = subHTML
end function

.... blah blah blah ....

%]

Obviously I can't use the < option for the javascript tags because that 
is a display option. It looks like the ASP parser in II5 is "very" picky 
about script tags, too picky. Go figure.
----
Anthony Baratta
President
Keyboard Jockeys





More information about the thelist mailing list