Try two Ajax errors

Source: Internet
Author: User

Today, I want to pass all the content of another webpage to a div of this webpage,CodeAs follows:
......
VaR xhttp = new activexobject ("Microsoft. XMLHTTP ");
Xhttp. Open ("get", "http: // 127.0.0.1/1.asp", false );
Xhttp. Send ();
Document. getelementbyid ("mydiv"). innerhtml = xhttp. responsetext;
......
No response.
I always thought that 1. asp was too complicated and failed. After trying for half a day, I finally tried to use this statement:
Document. getelementbyid ("mydiv"). innerhtml = "<HTML> <body> OK </body> I still can't. Finally, I made a comparison with the previous one to find that innerhtml was wrong and written as innerhtml. There are no prompts for vs2005 or IE! Bitter!

After the modification, I made another step. The error prompt is "unknown runtime error". After Google, I found the cause: I have a form on this page named form1, the new web page also has a form named form1, which causes a conflict. However, vs2005 did not point out the specific cause, but told you "unknown runtime error ".

Later, I found that JavaScript cannot be executed. In short, I feel that AJAX is a very immature technology for me.

Related Article

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.