Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

OT: ASP javascript comments

LEGEND ,
Oct 04, 2006 Oct 04, 2006
I'm hacking some crappy ASP application that was written entirely in
javascript.

I want to add some code comments, but the standard ASP (VB) comment seems to
not close itself:

<% ' comment %>

Instead, if I use that syntax, EVERYTHING after it (even outside the closing
asp tag) is commented. Is there a different way to handle javascript ASP
comments?

-Darrel


TOPICS
Server side applications
434
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2006 Oct 04, 2006

> Instead, if I use that syntax, EVERYTHING after it (even outside the
> closing
> asp tag) is commented. Is there a different way to handle javascript ASP
> comments?

JavaScript comments are the same as client-side JavaScript comments:

<% // single line comment
var something = 'blah';
/* Multi line comment
spans several lines */
%>


--
--
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/

Cartweaver Development Team
http://www.cartweaver.com

Extending Knowledge Daily
http://www.communitymx.com/


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2006 Oct 04, 2006
> JavaScript comments are the same as client-side JavaScript comments:
>
> <% // single line comment
> var something = 'blah';
> /* Multi line comment
> spans several lines */
> %>

'doh! Duh. I should have figured that one out! Thanks, Tom!

-Darrel


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2006 Oct 04, 2006
Tom:

Here's another one for you:

<% <FRAME TITLE="<%=UtilHTMLEncode(sFrameTitle)%> " SCROLLING="NO"
MARGINWIDTH="0" MARGINHEIGHT="0"
SRC="CommonDetails.asp?strFormSeq=<%=encodeURIComponent(strFormSeq)%>&PopupSeq=<%=encodeURIComponent(objDetailPopup.Sequence)%>"
NAME="<%=objForm.Sequence%>"> %>

How would I comment the above?

The problem is the nested ASP tags within the main ASP tag.

-Darrel


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2006 Oct 04, 2006
As far as I know, that code is not legal. The outer <% should not be there.
Is it a frame tag with dynamic attributes?

You have to use single line comments before the =:

<%//=encodeURIComponent(strFormSeq)%>

Tom

"darrel" <notreal@nowhere.com> wrote in message
news:eg0q5t$oqq$1@forums.macromedia.com...
> Tom:
>
> Here's another one for you:
>
> <% <FRAME TITLE="<%=UtilHTMLEncode(sFrameTitle)%> " SCROLLING="NO"
> MARGINWIDTH="0" MARGINHEIGHT="0"
> SRC="CommonDetails.asp?strFormSeq=<%=encodeURIComponent(strFormSeq)%>&PopupSeq=<%=encodeURIComponent(objDetailPopup.Sequence)%>"
> NAME="<%=objForm.Sequence%>"> %>
>
> How would I comment the above?
>
> The problem is the nested ASP tags within the main ASP tag.
>
> -Darrel
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2006 Oct 04, 2006
> As far as I know, that code is not legal.

Ha!

> The outer <% should not be there. Is it a frame tag with dynamic
> attributes?

Yea.

> You have to use single line comments before the =:
>
> <%//=encodeURIComponent(strFormSeq)%>

Aha! That works.

Don't get me started on the crappiness of this code. ;o)

-Darrel


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2006 Oct 04, 2006
I think this code is very crappy.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"darrel" <notreal@nowhere.com> wrote in message
news:eg12pu$6ap$1@forums.macromedia.com...
>> As far as I know, that code is not legal.
>
> Ha!
>
>> The outer <% should not be there. Is it a frame tag with dynamic
>> attributes?
>
> Yea.
>
>> You have to use single line comments before the =:
>>
>> <%//=encodeURIComponent(strFormSeq)%>
>
> Aha! That works.
>
> Don't get me started on the crappiness of this code. ;o)
>
> -Darrel
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 05, 2006 Oct 05, 2006
LATEST
There's a reason alot of people go to great lengths to separate logic from markup.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines