保存html文件时出现编码问题 [英] Encoding issue in saving html file
问题描述
我正在ASP.NET中开发一个网站.尝试阅读
时遇到问题
值.aspx
页(使用jsonp
).我尝试使用Firebug看到此问题,并且在我的html
文件之一中显示了错误.这是屏幕截图: http://i.imgur.com/GlQjC.jpg [ http://pastebin.com/V3f6KDSa [ http://i.imgur.com/h67Me.jpg [ ^ ]
我没有在此html
文件中看到任何错误.我猜这种编码可能是错误,但也可能存在其他一些问题.我正在尝试使用getJSON
读取menu.aspx
的输出.
我的menu.aspx
页面上的输出类似于:
使用此`.cs`代码的HTML格式的foo({"1":"Jeff","2":"Mic","5":"Mark"});
Hi,
I am developing a website in ASP.NET. I am facing a problem while I am trying to read the
values .aspx
page(using jsonp
). I tried seeing this problem using Firebug and it was showing an error in one of my html
files. Here''s the screenshot: http://i.imgur.com/GlQjC.jpg[^]
I checked the respective html
file and it was correct (according to me) except that I remember Visual Studio giving me some prompt regarding some encoding after which I saved the file. This was probably because this html file came from a Linux system. Here''s my html file: http://pastebin.com/V3f6KDSa[^]
Can there be such a problem because I then checked in Google Chrome too and it was giving an error as shown in this screenshot: http://i.imgur.com/h67Me.jpg[^]
I didn''t see any error in this html
file. I am guessing this encoding might be the error but there could some other problem too. I am trying to read the output of a menu.aspx
using getJSON
.
The output on my menu.aspx
page is something like:
foo({"1":"Jeff","2":"Mic","5":"Mark"});
in html form using this `.cs` code
outputText += Convert.ToString(k.GetValue(0));
for (Int32 i = 1; i < k.Length; i++)
{
outputText += "," + Convert.ToString(k.GetValue(i));
}
//
outputText += "}" +");";
Response.Write(outputText);
请提出解决方案.
Please suggest something to resolve this.
推荐答案
您是否尝试过删除第68行(pastebin链接)的getJSON
调用内的Comment,
如果要注释,则将其放在回调函数中看起来不正确.
例如变化;
Have you tried removing the Comment within thegetJSON
call at line 68 (pastebin link),
It doesn''t look right having the comment in the call parameter, if you want to comment put it in the callback function.
e.g. change;
.getJSON( " + farfalla_profile + " ,{}, // 调用插件 功能(数据){
.getJSON( "profiles/retrieve.aspx?id="+farfalla_profile+"&callback=?", {}, // Recall the plugins function(data) {
到;
to;
.getJSON( " + farfalla_profile + " ,{}, 功能(数据){// 回收插件
.getJSON( "profiles/retrieve.aspx?id="+farfalla_profile+"&callback=?", {}, function(data) { // Recall the plugins
值得一试.
Worth a shot.
这篇关于保存html文件时出现编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!