Re: embedding html in a javascript function



Rick wrote:

> well...i want to put some .asp code into my javascript function. i
> have a function that, when the user presses a button, generates three
> text boxes, and i want to add some asp code to that function so that i
> can write the user inputted data over to my database. any suggestions?

Short answer is: You can't.

1. The browser makes an HTTP request
2. The server executes the ASP and generates an HTTP response
3. The browser recieves the HTTP response and parses the HTML, executing any
JavaScript it finds.

To send data from the browser back to the server to process that data with
ASP requires another HTTP request. This is typically done by directing the
browser to a new URL. Another option is the XMLHttpRequest object.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
.



Relevant Pages

  • Re: embedding html in a javascript function
    ... >well...i want to put some .asp code into my javascript function. ... >have a function that, when the user presses a button, generates three ... sent to the client and displayed in the client's browser. ...
    (comp.lang.javascript)
  • Re: Weird Select object problem
    ... number of entries leads me to believe that there is something in my ... realize that the browser may be interpreting something that I have ... So I guess it's something in the asp code causing it ... >> it should when I hit a letter key. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Encrypt String or different approach
    ... ASP code. ... >> The user then won't see any info in the address bar ... > But it'd still be open by viewing the contents of the HTTP request. ... > 1) You could always use a URL Rewriter or something that would inspect the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Encrypt String or different approach
    ... ASP code. ... >> The user then won't see any info in the address bar ... > But it'd still be open by viewing the contents of the HTTP request. ... > 1) You could always use a URL Rewriter or something that would inspect the ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Dynamic creation of ASP code
    ... You just write some text (that happens to be "ASP code") to the browser ... exacly as if it were HTML code. ... You have actually to execute the code (using ...
    (microsoft.public.inetserver.asp.general)