Question

My page loads fine each time in all browsers, except in IE when I use the browser back button it's changing out the double quotes used for the value attibute of the option element to smart double quotes instead of straight ones.

Loads correct initially with straight double quotes:

<option value="500">500+</option>

IE9 browser back yields smart double quotes:

<option value=“500”>500+</option>

Then when I get the value in javascript, it looks like this: "“500”"
Why is it doing that in IE? and why is it only doing it upon backwards navigation?

Troubleshooting
Defining the following didn't help:

<meta charset='ISO-8859-1'>

Neither did adding the charset to all my external scripts since the html option element above is part of a jquery select element which gets modified before its rendered:

<script charset="ISO-8859-1" type="text/javascript" src="...jquery-at-google"></script>

Some more Info:
The characters are from the ANSI Windows Code Page 1252.

  • Character : Code point : WINDOWS-1252
  • “ : U+201C : 93
  • ” : U+201D : 94
Was it helpful?

Solution

I'm developing in Visual Studio 2010 and it seems that the port used for the development server is causing the problem because when I change it to another random port, the problem goes away. Not sure why though, just that changing the VS development server port fixes this issue.

Changed this in the .csproj:

<DevelopmentServerPort>49288</DevelopmentServerPort>

To this:

<DevelopmentServerPort>53845</DevelopmentServerPort>

fixed it. Or you can just change it in the project properties. No idea why though, other than that VS2010 must of somehow corrupted that server somehow.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top