Add sniffer to HTML

Results 1 to 2 of 2

Thread: Add sniffer to HTML

  1. #1
    Join Date
    Dec 1969

    Default Add sniffer to HTML

    Can I hit an ASP page from an HTML page? I have an HTML page to send out via email, I also have a ASP sniffer page that grabs browser info, IP, etc.. and adds it to my database.<BR><BR>How can I get the HTML email to hit the ASP page everytime someone opens the email?<BR><BR>OR do you know a better way to accomplish the same thing?

  2. #2
    Join Date
    Dec 1969

    Default Just an idea...untested...

    In the HTML, do this:<BR><BR>&#060;SCRIPT Language="JavaScript" Src="xyz.asp?param=123"&#062;&#060;/SCRIPT&#062;<BR><BR>This does a dynamic include of what the browser *EXPECTS* to be pure JavaScript code.<BR><BR>So if you do *ANY* Response.Write or equivalent in the ASP file you invoke this way, be *SURE* it is pure JavaScript! You can&#039;t even send &#060;HTML&#062;, &#060;BODY&#062;, etc., tags. They *will* break. It is, however, okay to have the .asp page return absolutely nothing. (That is, have the page start with &#060;%, end with %&#062;, and never break out of the ASP tags anyplace in between. And never do a Response.Write or any other Response.XXX call.)<BR><BR>[You *can*, though, return valid JS code if you want to! Maybe something like this:<BR><BR>******** FILE: xyz.asp ***********<BR>&#060;%<BR>param = Request.QueryString("param")<BR>%&#062;<BR>documen t.write(&#039;Thanks for tellin me the param was &#060;%=param%&#062;!&#039;);<BR>***** end of file *******<BR><BR>See how the only stuff written out by that ASP page is valid JS code? (And *without* the &#060;SCRIPT&#062; tags, note.)<BR><BR>Anyway, this obviously only works if the user has JS enabled in the sub-browser that is invoked by the email reader. I know that, in my own case, I disable JS in that environment. Sorry about that.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts