Skip to content
  • Home
  • Work
  • About
  • Blog
  • Contact

Save As Web and IE8

John Goldsmith's profile image

John Goldsmith

04 April 2009
  • General Use
  • Save as Web Page

Header

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

  1. Open the main .htm page that Visio generates in a text editor, such as Notepad, and search for var gParams = ParseParams (location.search);
  2. Replace this line with var gParams = “”;
  3. Save the file and close.

Option 2 – Fix the function

  1. Open the main .htm page that Visio generates in a text editor, such as Notepad, and search for function ParseParams (strRawParams)
  2. Add the two lines highlighted in the image below or just replace the entire function with the this code.
ParseParams

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.

Microsoft MVP Logo

John has been a Microsoft MVP, in the award categories of Visio and M365, since 2008.

Visio Blogs

  • Bill Morein (via Wayback Machine)
  • Chris Castillo (via Wayback Machine)
  • Chris Hopkins (via Wayback Machine)
  • David Parker
  • Eric Rockey
  • Jesse Phillips-Mead
  • John Marshall
  • Michel LAPLANE (FR)
  • Nikolay Belyh
  • Saveen Reddy (via Wayback Machine)
  • Visio Guy
  • Visio [Product] Blog
  • Visio Insights (via Wayback Machine)

Visio Resources

  • Developing Microsoft Visio Solutions
  • Visio Stencils at ShapeSource
  • Microsoft Visio YouTube Playlist
  • Visio (Product site)
  • Office 2010 Engineering
  • Visio 2016 SDK (Download)
  • Visio JavaScript API reference
  • VisioMVPs.org
Contact

visualSignals ltd
31 Riverview Grove
London, W4 3QL
United Kingdom

+44 (0) 208 078 9120

Around the Web

Copyright © visualSignals ltd 2025

Mastodon