Asp and simple AJAX applications

Related Tags:

  Today, a reader friend asked me: ASP can be achieved AJAX?    Of course, this is a relative comparison, the rookie questions, in fact, any site dynamic scripting language can be achieved AJAX, because AJAX itself is the concept of javascript, and used by the dynamic scripting language unrelated.    So I decided to do a first Laijiangjiang ASP AJAX Application bar. 

  First speaking, what is AJAX, it is a written AJAX, and his name is Asynchronous JavaScript and XML, there is a Asynchronous "asynchronous", I mean, AJAX is "Asynchronous Javascript and XML," short.    From the names we can clearly see, AJAX lies Javascrip and XML, "asynchronous" how stresses, it reflects a dynamic asynchronous request process, I will be here for his simple understanding, the website after the download is complete, then through Javascript sent to the remote server access to certain information and feedback from an act. 

  So, what is involved in AJAX technology to, first of all, need to use Javascript AJAX components to the xmlhttp and server communication, and secondly, through the XMLDOM need to know the return of xml data analysis methods, finally, also need to understand the basis of the data to change return Web certain Element method. 

  Nonsense here do not explain the theory of those boring, I will code-writing involved in the distribution of knowledge in the specific examples in on. 

  Wrote the above text, I would like to have been, relatively speaking examples of how could they do a good thing, here with a relatively simple AJAX "an article on" as a good example. 

  First make system outlined in the article shows that the page displays a text box and a button to when the submit button is clicked, the page will not refresh the data to the server, when after submission, the server will return a xml file to tell whether the current javascript successfully handled. 

  OK, the system outlined last night, and we probably under the terms of the database structure. 

  Article Table 

  Field names 

  Field Types 

  Role 

  Remarks 

  ArticleID int article # primary key, since by ArticleTitle nvarchar (50) titles ArticleContent ntext article content 

  ArticleComment Table 

  Field names 

  Field Types 

  Role 

  Remarks 

  ArticleComentID int comment # primary key, since by ArticleID int article # foreign key ArticleCommentContent nvarchar (100) comment on the content 

  Page article has nothing to do I do not write the code, in order to simplify some of my Comments only comment on the content, and not to comment on what the nickname, the reason is the same, we can all cite one of the three.    Comments related forms part of the code as follows: 

<div>
  <h1> Comment on the article </ h1> 
  <textarea Id="u-comment"> 
  Please enter your comment! 
  </ Textarea> 
  <Input type = "button" onclick = "post (<= lArticleID%%") "value =" comment "/> 
  </ Div> The above code is mainly to draw attention to two points: first, an article on the text box id "u-comment" and the second, when click the "comment" button, function post operation (< % = lArticleID% ").    Note here actually embedded in an asp variables, we assume that the variables lArticleID asp inside is kept open the article, the current number, in addition to comments on the set add to the article under which, if the current article No. 574, here post the html code is (574).    OK, on completion of the form, we look at this page javascript code. 


Related articles:

Random code generated by Flash
  We often see a lot of random code, such as login authentication code, we adopted the following Flash to generate a random code    A new Flash document, in the first frame placed inside a dynamic text, examples: yanzhengma    In the first frame, the frame moves inside at...
DreamWeaver create Web Query System 2
  After the production of the preceding sections, the early site preparation work has been initially completed, the building started to build this section in all 114 pages.    Page document, the arrangement is    Like this:    Top_114.asp: is the top of all the ...
Site Design and Development Process Management
  NoahWeb use a Web development, you can development process is divided into three phases: phase needs to achieve stage, and launch stage.    In three phases, you can also ensure that it will always explore user needs, many customers will be delivered DEMO demonstration site because ...
A correct understanding of the web site search engine optimization strategy
  Search engine optimization is not the focus of the search engine rankings consider how the rules and, more importantly for users to access information and services provide a convenient, search engine optimization is the highest goal to users, rather than to search engines.    Search...
(Javascript) prototype is an advantage shortcomings
  Javascript realize how OO programming?    I am afraid that the best way is to make full use of prototype attributes.    On the prototype introduced many, I will not repeat the.    Comparing the basic principle is that when you used to prepare a prototype of late...