illusion 0 Report post Posted November 17, 2004 (edited) A direct relationship between the two is simply non-existant. Both technologies were developed by seperate companies which have relatively nothing to do with each other. JavaScript, a product of Netscape, was developed to allow web programmers to write applications which could interact with web browsers. Whilst Active Server Pages, on the other hand, was developed to allow programmers to create data driven websites. ASP, as the name implies, is a server-side technology. This fact alone forbids ASP from directly communicating with JavaScript. Infact, an ASP script will be completely executed and forgotten about by the time the page is even downloaded and displayed on the users screen. When a user requests a page, say 'category.asp', the browser will request the page from the server. Once the page has been located, the source code will be processed on the server and, if necessary, HTML code will be output and displayed to the user. With that said, it should now sound completely illogical to assign a JS variable to an ASP script without first sending the data to the server for processing. I am aware of the indirect ways which ASP can influence Javascript. Such as; setting Javascript variables from the server. The following is a simple example: code:-------------------------------------------------------------------------------- <% dim x x = 2 response.write("<script>var x = " & x & ";</script>") %> -------------------------------------------------------------------------------- The preceding ASP script simply defines a variable named 'x' and then prints its value to the output. This method actually doesnt show any evidence of ASP and JavaScript communicating. Some people will say "But you can use JavaScript to write ASP scripts". This actually isnt true. You can use a spawn of JS call JScript. JScript was also developed by Microsoft and is used for both client side and server side scripting. When using JScript in an ASP application, you would not refer to it as JS, but as ASP, none the less -----Copied without quotes from http://forums.xisto.com/no_longer_exists/ -----szupie Edited October 23, 2005 by szupie (see edit history) Share this post Link to post Share on other sites
marsden 0 Report post Posted June 18, 2006 No offense but doesn't ASP mean acitve server pages? If you used JavaScript to connect to a DB and display records on a web page then basically that it what it is, an active server page.Just my option. Share this post Link to post Share on other sites