What are the ajaxjs functions used in PJBLOG
This article mainly introduces which ajaxjs functions are used in PJBLOG, which are very detailed and have certain reference value. Friends who are interested must finish reading them.
Function $(id)
{
Return document.getElementById (id)
}
Function echo (obj,html)
{
$(obj) [xss_clean] = html
}
Function fopen (obj)
{
$(obj) .style.display = ""
}
Function fclose (obj)
{
$(obj) .style.display = "none"
}
Function createxmlhttp ()
{
Var xmlhttp=false
Try {
Xmlhttp = new ActiveXObject ("Msxml2.XMLHTTP")
}
Catch (e) {
Try {
Xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP")
}
Catch (e) {
Xmlhttp = false
}
}
If (! xmlhttp & & typeof xMLHttpRequestrated undefined) {
Xmlhttp = new XMLHttpRequest ()
If (xmlhttp.overrideMimeType) {/ / set the MiME category
Xmlhttp.overrideMimeType ('text/xml')
}
}
Return xmlhttp
}
Function getdata (url,obj1,obj2)
{
Var xmlhttp=createxmlhttp ()
If (! xmlhttp)
{
Alert ("your browser does not support XMLHTTP clients!")
Return
}
Xmlhttp.onreadystatechange=requestdata
Xmlhttp.open ("GET", url,true)
Xmlhttp.send (null)
Function requestdata ()
{
Fopen (obj1)
Echo (obj1, "loading data, please wait a moment.")
If (xmlhttp.readyState==4)
{
If (xmlhttp.status==200)
{
If (obj1 updated obj2) {fclose (obj1);}
Echo (obj2,xmlhttp.responseText)
}
}
}
}
These are all the contents of the article "what are the ajaxjs functions used in PJBLOG". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!