What are the common errors of Javascript in IE ?? The object is missing!

Source: Internet
Author: User
What are the common errors of Javascript in IE ?? The object is missing! JavaScript php lacks objects

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?


Reply to discussion (solution)

Where is the xmlHttp object defined?

I loaded a js script at the beginning of php and skipped it here.

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.

I have solved it myself. it turns out that there is still the xmlhttp lifecycle issue out of the suggestion on the third floor. we should declare the xmlHttp object before each usage, because it is used cyclically here, loading at the beginning of the file will result in an error!

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.