Scripts and asp code

Results 1 to 2 of 2

Thread: Scripts and asp code

  1. #1
    Join Date
    Dec 1969

    Default Scripts and asp code

    Can I use asp code in the middle of a script? Such as...<BR><BR>&#060;script language="Javascript"&#062;<BR>function somefunction()<BR>&#060;%<BR> ...aspcode...<BR>%&#062;<BR>Javascript code<BR>&#060;/script&#062;<BR><BR>Is this possible? Or, is there any way to access database data using Javascript? Thanks,<BR><BR>Casey

  2. #2
    Join Date
    Dec 1969

    Default RE: Scripts and asp code

    &#062; Can I use asp code in the middle of a [browser-side] script? <BR><BR>Yes, but the result may not be what you think.<BR><BR>The ASP code will 100% finish its work before the resultant page is sent to the browser. That is, you can&#039t ask ASP to change what it has done by clicking on some button or making some other kind of JS call.<BR><BR>So, typically, the best thing to do is to have the ASP code produce an array (perhaps even an array of JS objects) and then let the browser-side JS manipulate the array.<BR><BR>I have a (perhaps too complex) demo of this at<BR> -- see the next to last example on that page ("A table...that is sorted in the browser.")<BR><BR>Even if it is beyond what you want right now, hopefully it will give you some ideas of things to try and ways to go.<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