I have issue with dynamic loading of part of content on ASP classic page. I use AJAX to load on page dynamically, depending on dropdown selected option. Generated contains some Labels for containing dropdowns and option text inside of dropdowns. Labels are constants encoded in UTF-8 and contain some western European accented characters, and option texts are loaded from database, contain accented characters too but are coded in ANSI. tags are set to utf-8 but it affects only first load of page, cos its all put together on page. After selecting other options, AJAX fills with elements and it loads labels well but options text is messed up, so i guess AJAX doesnt load up encoding with text second and etc. times. Work-around was to change label text in constants and set <% Response.Charset = "windows-1252" %> on page that is beeing loaded first time. Now, i want to find better way for this, prefferably in AJAX response to set it all to UTF-8 or windows-1225, or to set each element on page to have different coding with ajax. I even tried Replace function from ASP classic, it works , but again it needs for each new accented letter other replace. Any help appreciated! :)
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- Using :remote => true with hover event
- Is there a way to play audio on a mobile browser w
- net::ERR_EMPTY_RESPONSE when post with ajax
- Easiest way to get json and parse it using JQuery
相关文章
- spring boot用ajax发送请求后,请求路径多了controller的路径
- 针对复杂结构的前端页面,如何更好地与后台交互实现动态网页?
- ajax上传图片,偶尔会出现后台保存的图片有错误或者已损坏,请问可能是什么原因造成的?
- 前端 我想知道怎样通过发ajax请求向服务器拿到数据然后分页显示 最好是点击一页就发一次请求
- 接口返回的数据格式如下,请问可以取到level值为2的name数组呢
- 如何通过页面输入账号密码提交给后端
- How to get jQuery.ajax response status?
- How to read local csv file in client side javascri
I think the best way to solve encoding issues is to switch to utf-8. Not only does it take away the headache of handling special characters in your own language, but pretty much (as I understand utf-8) all languages!
First, include the following meta-tag in the HTML head.
You will also need to set UTF-8 at the top of all asp-files that are involved.
Do note though that characters posted to and from your asp-pages (via a form for example) will be interpreted as utf-8. Internally in the script engine strings is stored as unicode. Make sure that consistently save the data as unicode in the database.
Read the answer to this question for more in-depth information