Link to home
Start Free TrialLog in
Avatar of Member_2_6492660_1
Member_2_6492660_1Flag for United States of America

asked on

Invalid JSON Response After Site Move Please Help

IIS 8.5   on windows 2012 R2 Server 64 bit

Moved my web site from a Windows 2003 Server using IIS6
All moved the asp Html code from wwwroot folder to wwwroot\music folder

I can access the site internally and externally no problem 95% of the site is working

I have two major problems I will ask the one here and create another issue later.

When I bring up two of the pages on the site I get this error

Data Tables Warning
Table ID = Example
Invalid JSON Response


This happens on any browser Saferi and IE 9 10 7 11  

I have used the F12 developers Tool in IE but I can not find any invalid data

You can check it out

http://www.tomsmp3.com

try the "Show ALL Albums" or "Show ALL MP3 Songs"


This all started after
1. Moved to IIS 8.5
2. Moved to another folder under wwwroot.
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

I would check out testing your JSONs with the following JSON validator:

Link:  http://jsonlint.com/

When I capture the JSON from the All Albums and drop it into the tools, I get the following error:


Results Loading

Parse error on line 9:
...n Up Now<div style="display: none">my fi
-----------------------^
Expecting '}', ':', ',', ']'

When I test the response from the All Artists, it checks out valid.

I would appear that there is a format issue with the 2 functions that are returning errors.

Dan
Avatar of Member_2_6492660_1

ASKER

Dan

Thanks for the response

I do not understand how by moving the site from one web server to another that this could happen.

My code has not changed

Can you take a look at my code?  I attached all the files.

none of this code changed from when it was on the windows 2003 server with iis 6
SelectAlbums.txt
MusicAJson.txt
SelectAlbums.txt
music3.txt
I am not sure why it would work on IIS6 and not IIS8.5.  After looking at the code, my suggestion is to try to simplify the code.

What is your database on the backend?

For example:
1. You have an ASP to convert data from an array into a JSON object.  Why not just return a JSON from the db query?

2. You have some long queries in code, why not build a view in your database and query that instead?  Since a view will contain all the needed fields, it's basically a SELECT * FROM view_name WHERE field = "something"  ...

3.  Use a 3rd party function to convert into JSON.
Link:  http://www.webdevbros.net/2007/04/26/generate-json-from-asp-datatypes/

4. Or maybe just use a stored procedure to return the JSON directly from the db.

Its a little bit hard to debug code when I don't have any data to test against.  But I will look thru the musicajson.txt you included since it appears to build the JSON.

Dan
I have all the data in a sql 2008 database.

Does that help
Here is a similar question on EE.  Requirements are a bit different, but essentially needed a JSON response:

Link:  https://www.experts-exchange.com/questions/28201280/Json-in-asp-classic.html

Dan
I need some sort of record set to test against.  I don't know what the data looks like.  Plus, debugging this may take a while.

Dan
Dan

I extracted a sample from my sql database

three tables
dbo.artists
dbo.recordings
dbo.tracks

Does this help
extract-db.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dan

I just checked my db

that div is not suppose to be in there  looks like my db is corrupt with search garbage

I was wondering why when I did a search from my page against the db I was seeing all kinds of garbage.

It must be the db causing this

Let me clean up the db first and see what happens

Any thoughts on how this web search junk got into my database?
Dan

Just cleanup up my SQL Database records all 45000 of them took some time to get the sql query to work to get rid of all the characters after the <div.........

but now works check it out

thanks Again