本文介绍了xml编码和jquery解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果我使用

$ b,那么我在使用jquery中包含swedish chars(åäö)
$ b

 <?xml version =1.0encoding =UTF-8?> 

 <?xml version =1.0encoding =ISO-8859-1?> 

我仍然会在jquery中得到一个parseerror。但是,如果我打开记事本中的文件++并保存utf-8没有BOM它将工作。但这不是一个选择,因为我不能假定所有的用户都会这样做。我该如何解决?谢谢!

解决方案

您收到的解析错误是什么?



XML文件无法正常工作的最常见问题是由空白引起的,所以也许值得一试。



一个有用的URL是



谢谢


Im having some trouble reading xml files using jquery that containts swedish chars (åäö) in my xml.

It doesnt matter if i use

<?xml version="1.0" encoding="UTF-8" ?>

or

<?xml version="1.0" encoding="ISO-8859-1"?>

i will still get a parseerror in jquery. However, if i open the files in notepad++ and save with "utf-8 without BOM" it will work. But this is not an option, since i cant assume that all teh users will do that. How do i solve this? Thanks!

解决方案

What is the parse-error you are receiving?

The most common issue with XML files not working correctly is caused by white space, so maybe worth checking this.

A useful URL is http://www.usingxml.com/Basics/XmlSpace

Thanks

这篇关于xml编码和jquery解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 04:00