Javascript always reports an error in IE-an object is missing! How to solve
Source: Internet
Author: User
Javascript always reports an error in IE-an object is missing! & Lt ;? Phpquery0 = mssql_query ("select & nbsp; * & nbsp; from & nbsp; tb_xm & nbsp; where & nbsp; xm_pcid = '1 '"); $ y = 1 Javascript always reports an error in IE -- an object is missing!
Query0 = mssql_query ("select * from tb_xm where xm_pcid = '1 '");
$ Y = 1;
While ($ myrow0 = mssql_fetch_array ($ query0 )){
?>
Function datawrite (){
If (xmlHttp. readyState = 4 | xmlHttp. readyState = 0 ){
XmlHttp. open ("GET", "kspf_conn1.php? Online_xm = "+" "+" & Online_user = "+" "+" & Online_ytbyx = "+ ytbyx +" & online_mbnr = "+ mbnr +" & Signature = "+ zjzb +" & online_ffjs = "+ ffjs +" & online_xyqj = "+ xyqj + "& online_jdjf =" + jdjf + "& online_zhpf =" + zhpf + "& online_sum =" + sum, true );
XmlHttp. send (null );
} Else {
The xmlHttp object in alert ("datawrite () is busy! ");
SetTimeout ('datawrite () ', 1000 );
}
}
Datawrite ();
}
?>
In the above code, the information in the project table is read cyclically and kspf_conn1.php is opened in XML to enter the database. after checking that the kspf_conn1.php file is correct. However, after you enter the preceding program, the error message "object missing" appears. the online_xm value indicates the project name. after you enter the database, you can see that the names of all projects are changed to the names of the last project. Why should I write different project names? JavaScript php lacks objects to share:
------ Solution --------------------
Where is the xmlHttp object defined?
------ Solution --------------------
Js errors should be checked on the generated page
You define the js function datawrite in the loop. (). Because $ y does not change in the loop, it just repeats the definition of the datawrite1 function. Naturally, only the last round of definition will take effect.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.