Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yesterday morning, I finally managed to get this JSON script working; however, it was by working around the problem. That said, I feel sure that I have at last managed to identify the root cause too - I just cannot rectify it.</p> <p>Below I have documented how I got the code to run and at the end is a list of areas that I researched. For those who can’t wait though, I just changed my JSON file names to .JS and changed my file paths to .JS too. </p> <hr> <p>My research has been extensive and if documented may help someone else facing the same or similar situation. I have also detailed my approach too; although the approach will be common sense to most it may help someone get to the root of a problem. </p> <p>By the way: Thanks to Juan from the YUI forum who to use his words provided a ‘second pair of eyes’ which confirmed up front that the problem was related to the JSON file not loading correctly. He also gave me some of his time – appreciated.</p> <p>By running the page in Firefox I was able to use the error console. This helped only at first though as after I had deleted any excess code other than that specifically related to the example the Firefox console did not give any errors even though the site script was not working?</p> <p>The Firefox error console did give two telling errors early on however: One related to the server not responding to the call and another outlining that there was a JSON MIME type issue again pointing to the server (IIS 7.0).</p> <p>I then changed the try/ catch error messages in the script to make them all different. Then I was able to see at which point in the script the application was failing according to which alert was showing.</p> <p>Before reaching this point I had got a bit side tracked searching Google for answers – it is easy to do. Working methodically with what I had in front of me enabled me to focus on more directly on specific issues though.</p> <p>I knew that I had issues with JSON files not running; I also knew that the server was not responding and that the server was not recognising the MIME type. Therefore, it seemed probable that if I sorted the MIME type issue on the server the server would recognise and run the JSON file.</p> <p>To add a new JSON MIME type I went to the Microsoft IIS knowledge base at the following link and read the instructions on how to set up IIS 7.0 to manage JSON files – sure enough JSON files were not listed in my IIS Manager as known file types.</p> <p>New MIME type = JSON Filename extension - .json MIME type description = application/json</p> <p><a href="http://technet.microsoft.com/en-us/library/cc725608%28v=ws.10%29.aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/cc725608%28v=ws.10%29.aspx</a></p> <p>As the site would still not work I looked deeper. More research told me that I needed to configure a handler mapping for my new JSON MIME type. Again I used the Microsoft IIS site: (Links removed due to insufficient reputation points)</p> <p>You may need to change your web.config in some cases so here’s another MS link:</p> <p>(Links removed due to insufficient reputation points)</p> <p>Again I ran into trouble as the ASP.DLL from C/ Windows/ system32/ inetsrv/ asp.dll was missing.</p> <p>To overcome this I found another copy from somewhere else on my system and copied the file into the inetsrv folder. The site was still not working though, so I carried on to discover that there should be at least one 32bit asp.dll file and one 64bit asp.dll file on the system. I presume that I had copied the incorrect bit asp.dll into the inetsrv folder and I could not identify which was which; so, that is where I got to.</p> <p>I then went back to basics trying to learn more about opening JSON files when I ran into a post on yahoo answers from a guy called Colanth who stated “JSON is a technique, not a format’.</p> <p>Thinking more about this statement I found another JSON tutorial that just focused on creating a simple JSON call function here:</p> <p>(Links removed due to insufficient reputation points)</p> <p>Noting that the tutorial also outlined that ‘JSON was a technique’ I read on. The tutorial detailed that JSON is JavaScript. </p> <p>Then, it occurred to me that if JSON is not the format but JavaScript is I should change the file name of my JSON files to .js and then change my JSON file paths to .js as my system recognises JavaScript to see what happens.</p> <p>So I did, and Blam! (To quote Dog the Bounty Hunter) Everything works!</p> <p>Granted I need to sort the MIME type and missing asp.dll issues. I think that the asp.dll might be missing because I uninstalled Visual Studio 2010 for VS2012 and the removal of VS2010 may have removed the asp.dll file. I understand that VS2012 builds on installed versions of VS2010 so VS2012 may have expected the asp.dll to already be installed. Saying that VS2010 should not have removed it if that is the case; who knows?</p> <p>Also, JSON files are JSON files for a reason so I need to get to the bottom of that issue to. But, after a lot of hard work I have a work around for the minute.</p> <p>Here are some other things that I checked that may give you some ideas too:</p> <p>URL’S, file paths and file names</p> <p>Localhost – which port the site and response files are running on</p> <p>JSON script using the validator for ideas: <a href="http://jsonlint.com/" rel="nofollow">http://jsonlint.com/</a></p> <p>Check he code for errors and typos</p> <p>Try running IIS on in 2.0 and 4.0 modes</p> <p>Check web.config script for JSON</p> <p>Tried running the code in html, aspx, cshtml and php websites</p> <p>Tried moving the JSON file to different locations; check JSON file paths</p> <p>Tried different YUI configurations both local and external using the Configurator</p> <p>Looked at different browser security settings</p> <p>Changed Firefox about:config: for security.fileuri.strict_origin_policy</p> <p>Increased timeout settings in the code</p> <p>Check yur system handles JSON MIME types</p> <p>Is the version of IIS correct 5.0, 6.0, 7.0 , 7.5 etc</p> <p>Check the server WCF settings</p> <p>Change code</p> <p>Change global settings</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload