无法从xml文件加载数据,html不受影响 [英] cannot load data from xml file, html not affected

查看:114
本文介绍了无法从xml文件加载数据,html不受影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ajax函数是在window.load上触发的,但它根本不会影响html。这是我的ajax:

my ajax function is triggered on window.load but it doesn''t affect html at all. Here''s my ajax:

展开 | 选择 | Wrap | 行号

推荐答案

你怎么知道它的触发器?$ />

第25行和第26行,它是getElementsByTagName,而不是getElementByTagName。
How do you know it triggers?

On line 25 and 26, it''s getElementsByTagName, not getElementByTagName.


是的,我改变了代码,但它仍然没有''工作,我在谷歌控制台上的网站和我得到的错误是

未捕获的SyntaxError:moje.js第1行的输入意外结束

未捕获的ReferenceError:进程是没有为webdesign.html的第71行定义这基本上是带有process()函数的按钮


所以它基本上是我的javascript文件的第一行:var xmlHttp = createXmlHttpRequestObject();

然后一个按钮在html中触发我的功能

我的完整ajax:
Yeah ive changed the code but it still doesn''t work, ive runthe website on google console and the errors ive got are
Uncaught SyntaxError: Unexpected end of input for line 1 of moje.js
Uncaught ReferenceError: process is not defined for line 71 of webdesign.html which is basically the button with process() function

So it''s basically the first line of my javascript file: var xmlHttp = createXmlHttpRequestObject();
and then a button that triggers my function in html

my full ajax:
展开 | 选择 | 换行 | 行号


跳出来的第一个错误是你的javascript代码块的第7行,XLHttpRequest应该是XMLHttpRequest
The first error that jumps out at me is that on line 7 of your javascript code block, XLHttpRequest should be XMLHttpRequest


这篇关于无法从xml文件加载数据,html不受影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆