I came across an issue recently with Visio’s Save As Web output and IE8. Basically a JavaScript function, which had worked quite happily in IE6 and 7, now throws an error as the main page loads.
I believe this issue will be addressed in the next Office 2007 SP2, coming soon, but until then and for any legacy sites there’s a fairly quick fix…
Background
Visio’s Save As Web output contains, amongst other things, a method to parse parameters contained in the URL. This enables you to add specific zoom, page index, shape focus and search settings in the following format:
http://www.domain.com/VisDiagram.htm?page=1&zoom=200
The function responsible for extracting the parameters is called ParseParams and it’s this function that falls over when passed an empty string.
Workaround
There are two options here, to fix the problem – one is to ensure the function isn’t called in the first place (probably the simplest fix if you never intend to use URL parameters), and two, to deal with the empty string issue inside the function itself.
Option 1 – Stop calling the function
- Open the main .htm page that Visio generates in a text editor, such as Notepad, and search for var gParams = ParseParams (location.search);
- Replace this line with var gParams = “”;
- Save the file and close.
Option 2 – Fix the function
- Open the main .htm page that Visio generates in a text editor, such as Notepad, and search for function ParseParams (strRawParams)
- Add the two lines highlighted in the image below or just replace the entire function with the this code.
While this is a bit of a nuisance to have to change things, the benefits are a much improved JavaScript engine in IE8. I’ve certainly seen a really noticeable difference in performance on JavaScript heavy sites such as Netvibes.com for example.
If you're interested in other js changes in IE8 then you might want to have a look at the JScript team blog.