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

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.
LVL 23
Thomas GrassiSystems AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


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.

Thomas GrassiSystems AdministratorAuthor Commented:

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
Dan McFaddenSystems EngineerCommented:
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.

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.

10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Thomas GrassiSystems AdministratorAuthor Commented:
I have all the data in a sql 2008 database.

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


Dan McFaddenSystems EngineerCommented:
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.

Thomas GrassiSystems AdministratorAuthor Commented:

I extracted a sample from my sql database

three tables

Does this help
Dan McFaddenSystems EngineerCommented:
First glance, you have HTML in the tables.  You will need to escape the data.

For example:
record 1 on sheet3, in the TrackFileName field, there is a DIV statement with a style declaration.

IMO, storing the HTML in this manner is not a best practice.  Maybe you should consider breaking up this field into more than 1 monster field which will reduce all the VBSript "replace" function calls.

I'm guessing that the problems you are having are due to the double quotes stored in the field and they are not being considered in the replace function when you try to build the JSON.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Thomas GrassiSystems AdministratorAuthor Commented:

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?
Thomas GrassiSystems AdministratorAuthor Commented:

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.