Java Script written by ASP not working?

Results 1 to 2 of 2

Thread: Java Script written by ASP not working?

  1. #1
    Join Date
    Dec 1969

    Default Java Script written by ASP not working?

    I am trying to write cookie text(java) into a .htm file.<BR><BR>The code to create the cookie works quite well on it&#039s own when placed in a web page.<BR><BR>When I include the code in the header file it does not. I&#039ll explain...<BR><BR>A user comes to my site. Fills out a form and hits submit. I take this data and .CreateTextFile with it. In the I have the Java code to create a cookie when this file is viewed by this user, or another user at another time. The code will not work. Infact, just to see if I errored in writing it(ie..proper usage of chr (34) and so it looks pretty in view source, the ol&#039 "vbCrLf" for proper returns) I cut and paste this code from view source after the fact to a new .htm page and it worked flawlessly.<BR><BR>Can the format in which it is being filed(fso), and or written, remove meaning from my installed code?<BR><BR>This has got me living at my PC...anyone got any info on this I sure would appreciate a tip or two...<BR><BR>Thanks in advance,<BR><BR>Tim Brenz

  2. #2 Guest

    Default RE: Java Script written by ASP not working?

    If the client-side java is not with in a subroutine, then the code will be executed as it is read by the browser, if the JS references an object which does not yet exist in the html befor the point at which the code is executed, an error would occur. Also if you ASP output is not buffered (ie you don&#039t use the command "Response.Buffer=true"), you browser may receive part of the HTML including the JS before the object, to which it applies.<BR><BR>Try adding the line <BR><BR>&#060;%Response.Buffer=true%&#062;<BR>ne ar the top of your script.<BR><BR>If this does not help, we need to see your script.

Posting Permissions

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