Home > Web Front-end > JS Tutorial > body text

Without AJAX and IFRAME, let's talk about the real ASP JS refreshless technology_javascript skills

WBOY
Release: 2016-05-16 19:00:31
Original
1008 people have browsed it

What is being circulated on the Internet is that the ASP in > has no refresh. Adding an IFRAME and making JS cannot be called no refresh at all...
The code is not case-sensitive, please modify it yourself!
Full static no refresh idea:


//Countless new calls globally on the current page




//Example call one, direct call ASP
My database has //Example call two, event call AJAX.ASP My database has
entries



//AJAX.ASP code in Example 2
SET RS = CONN.EXECUTE(SQL_STR)
RESPONSE.WRITE "DOCUMENT.GETELEMENTBYID('COUNT'). VALUE = '"&RS("COUNT")&"'"
%>
///////////////////////////// ///////////////////////////////////////////////////// ///////////////////////////////////////////////////// ///////////////////////////////////
Part of the HTML code is omitted below, only the idea is explained
// Example 3 FORM form ONSUBMIT event calls AJAX.ASP

//This sentence is required






//Example 3 AJAX.ASP code
RESPONSE.WRITE "alert('"&request("a")&"');"//////Or write response.write "document.getelementbyid('id').innerhtml='Some html code';"
%>
/////////////////// ///////////////////////////////////////////////////// /////////////////////////////// Advantages: <script> //一系列JS调用 <BR>FUNCTION XX(FUN_NAME,PARAMETER_NAME,PARAMETER_VALUE)//参数自己设定 <BR>{ <BR>DOCMENT.SCRIPTS[0].SRC='AJAX.ASP?'+PARAMETER_NAME+'='+PARAMETER_VALUE;//参数以此类推 <BR>} <BR></script>The advantage of this no-refresh method compared to AJAX technology is that This method requires writing less code, is more concise, and develops faster. There is no need to write overly complex JS judgments. It also uses JS, but does not use DOM XML. It also has the advantage of cross-platform and can achieve the same advantages as AJAX. The user experience effect can be used simultaneously with AJAX. The code writing modes and processes for implementing different functions are almost the same, making it easier to improve code reusability. In fact, you only need to create 2 files to realize various functions of the website Disadvantages: Because this technology completely relies on JS to assign values ​​to the URL or COOKIES, and then passes parameters through the URL and cookies, but the size and length of the URL and cookies parameters are limited, so it cannot send a large amount of information like AJAX unless it is modeled after AJAX. Or use AJAX directly, but I believe I will find a better solution <script> <BR>function CHECK() <BR>{ <BR>alert('1'); <BR>//document.getElementByID("") <BR>document.scripts[0].src = "AJAX.ASP?a="+escape(document.getElementById('T1').value);//这里给第一个script.src赋值 <BR>alert(document.scripts[0].src);//查看测试地址是否正确 <BR>return false; <BR>} <BR></script>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template