Click here to Skip to main content
14,836,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

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:[^]

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:[^]

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:[^]

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 += "}" +");";


Please suggest something to resolve this.
Updated 21-Jan-11 7:40am
DaveAuld 21-Jan-11 13:41pm
Edit: Link added to 1st screenshot.

1 solution

Have you tried removing the Comment within the getJSON 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;

                                "profiles/retrieve.aspx?id="+farfalla_profile+"&callback=?", {},
// Recall the plugins
                                function(data) {

                                "profiles/retrieve.aspx?id="+farfalla_profile+"&callback=?", {},
                                function(data) { // Recall the plugins    

Worth a shot.
optimus_prime1 21-Jan-11 14:12pm
@DaveAuld: Tried that but still the same. However, in Firebug a the end of html file, these symbols are shown. Is this something related to encoding?
DaveAuld 21-Jan-11 14:14pm
Hmmm, try opening the file in visual studio or wherever, and save as UTF-8 encoding and see if that makes a difference then. Alternatively, copy and paste the text, into a new vanilla page and save with the same name and see what happens.
optimus_prime1 21-Jan-11 14:18pm
Already saved it in UTF-8(without signature)-Codepage 65001 from Visual Studio Adavnced Save options. Also, copied and pasted the code from Visual Studio to a new notepas and saved it as form.html and it didn't show any warning/error. :-|

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900