一直揭示:xmlhttp is not defined
一直提示:xmlhttp is not defined
描述:在做一个公共聊天室的页面,在用户提交发言后,在公共讨论区显示发言。
talk.php文件中的提交代码:
其中还包含了:
js函数tk就是在main.js中定义的,代码为:
function tk(form,maxtm){
if(form.cont.value==""){
alert("发言不允许为空!");
form.cont.focus();
return false
}
face = form.face.value;
color = form.color.value;
obt = form.obt.value;
cont = form.cont.value;
var url = "talk_chk.php?action=send&face="+face+"&color="+color+"&obt="+obt+"&cont="+cont;
xmlhttp.open("Get",url,true);
xmlhttp.onreadystatechange = callback;
xmlhttp.send(null);
form.cont.value="";
form.cont.focus();
refrsh(maxtm);
return false;
}
但是提交发言后,提示: xmlhttp is not defined !! 弄了一晚上了,跪求!!!!!!
xmlhttprequest.js中的代码:
if(window.ActiveXObject){
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpReuqest){
xmlhttp = new XMLHttpRequest();
}
------解决方案--------------------
else if( window.XMLHttpReuqest )
这里错了, 是 XMLHttpRequest
所以这才导致没有进入任何一个分支,自然xmlhttp未定义
------解决方案--------------------
IE下的有几个不同版本 找齐咯
------解决方案--------------------
别用原生的xmlhttp,用类库吧,jquery,mootools皆可

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

BinaryX's token name change: from BNX to FOUR, and then to FORM, the deep meaning behind strategic adjustments BinaryX recently changed the token symbol from $FOUR to $FORM, which has attracted widespread attention from the industry. This is not the first time BinaryX has changed its name, and its token symbol has undergone a transition from BNX to FOUR. This article will explore in-depth the strategic intentions behind this series of name change. 1. Token name change process and strategic considerations BinaryX initially launched the $BNX token based on the BNB chain in 2021 to support its Play-to-Earn (P2E) gaming ecosystem. In early 2024, in order to optimize the economic model, BinaryX divided $BNX and gradually expanded to GameF

There can be multiple forms in html5. The rules allow multiple form tags to be used in the same HTML page. However, in order to prevent the backend from not recognizing it when submitting, you need to add different IDs or classes to the form. The syntax is "<from action="url" id=" id value 1">Form element</from><from action="url" id="id value 2">Form element</from>.....".

The tag defining a form in HTML5 is "<form>". The form tag is used to create an HTML form (form field) for user input to collect and transfer user information. All content in the form will be submitted to the server; the syntax "<form action="Submit Address" method="Submit Method " name="form name">form control</form>". A form can contain one or more form elements, such as input, select, and textarea.

This article gives you a detailed summary of the knowledge points related to form elements in HTML. I hope it will be helpful to you!

php记录搜索引擎蜘蛛爬行记录代码。php教程记录搜索引擎蜘蛛爬行记录代码 center form action=setup.php method=post table align=center tr td服务器:/tdtdinput value=localhost name=server //td /tr tr td用

Solution to form form cannot be submitted to PHP: 1. Open the corresponding code file; 2. Modify the "onload="javascript:document.form1.submit();" statement; 3. Change the name of submit.

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。
