this is my page Test1.asp
Your methodology is slightly amiss. Typically, AJAX is used to send and receive data in non-HTML formats, such as XML, JSON, or sometimes even CSV (however, HTML is sometimes returned to the client, but usually as pieces of a page, not entire pages as in your example).
Logic is rarely transmitted and is usually maintained on the respective sides of the transmission. In other words, the client/request side has all of its own logic and already knows what to do with the data returned from the server/response side (which also doesn't accept or require any logic generated from the client side). Further, the use of eval
, which is usually necessary to consistently execute the logic found in the response, is generally frowned upon and considered a bad practice, thus the saying, "eval is evil."
In some cases, it may be necessary, advantageous or just plain easier to receive logic as part of the response from the server. In these situations however, it is still considered a best practice to separate your data from your logic.
All that to nicely say that you're doing it wrong. I encourage you to read up on how AJAX works and how best to use it: w3schools walk-through, Mozilla MDC intro, AJAX and XML processing, updating a page (similar to what I think you're trying to do), and finally, AJAX API docs for jQuery, Prototype and Dojo.