Why is this executing?

Results 1 to 2 of 2

Thread: Why is this executing?

  1. #1
    Join Date
    Dec 1969

    Default Why is this executing?

    I have a page that displays a link that when clicked goes to a page that deletes that entry fom the database. I wanted to put an alert in so on the page that deletes in the HEAD I put this:<BR><BR>&#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR>&#060;!-- Begin<BR>var agree=confirm("Are you sure you want to delete this date?");<BR>if (agree)<BR>document.write("");<BR>else<BR>history. go(-1);<BR>// End --&#062;<BR>&#060;/SCRIPT&#062;<BR><BR>If you click Cancel it should return you to the page and NOT execute the delete code that is in the body of the page. Correct? But it does th delete whether you click Cancel or OK. I&#039;m not much for javascript so what am I missing here?

  2. #2
    Join Date
    Dec 1969

    Default ASP is server side

    All your ASP code (such as the delete statment) is being processed on the server before you ever get to see the JavaScript code (JS is client side)<BR><BR>you need to include the JS on the First page, or on an interstital page BEFORE you load the script to perform the delete. <BR><BR>Shane

Posting Permissions

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