I have developed a website where the "back" button does not always go back to the previous page when using IE - no issue with Firefox or Chrome. It seems that for certain page changes, IE cannot initially display the page, and then successfully loads it, but the initial failure appears in history.
Then when you hit "back" it first goes back to the error entry (though nothing changes on screen) and then a second hit of the button takes you back a page.
I don't see the same behaviour on firefox, and I am not doing any redirects in the page transitions, and the only .htaccess
rule I have is for FURL, which is a direct re-write, no redirects:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Can anyone suggest an approach to finding out what IE didn't like on the page, that would cause this to happen?
The same behaviour is happening in IE7 and IE9.
Update: I think I have isolated this to linkedin plugins. These are used throughout the site. Pages that do not have any plugins work as expected, nothing weird in history. On some pages I have the "Follow Us" plugin:
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/FollowCompany" data-id="568783" data-counter="none"></script>
And these have a single "Cannot Display Page" in the history once you go to the page. On another page, I have 6 plugins called, to populate a team page with 5 profiles from linkedin, and a Follow Us
plugin. Each call to linkedin results in a "cannot display this page" in the history:
Any ideas why this would happen?
This answer doesn't address what is happening, but I'll leave it here until the real answer is uncovered (this issue will probably need to be fixed by LinkedIn themselves).
LinkedIn like you to use their plugins to pull in content, however they cause this issue by a weird redirect and the error appearing in the history, breaking the back button. The javascript inserts two levels of iframe into the page, however you can just get the second level frame and put this directly into your html. This has the benefit of being much faster, and has the downside of needing to be maintained in case anything changes in the backend at LinkedIn.
For example, this iframe will pull in the Follow Us plugin for a specific company:
<iframe id="easyXDM_IN_Lib_li_gen_1346300675316_0_provider" frameborder="0"
src="http://www.linkedin.com/cws/followcompany?companyIdentifier=568783&counterPosition=none&original_referer=http%3A%2F%2Fwww.marshallmcadam.com.au%2Four-team.html&token=&isFramed=false&lang=en_US&_ts=1346111060041.3884"
style="width: 83px; height: 20px; display: inline-block;"
name="easyXDM_IN_Lib_li_gen_1346300675316_0_provider">
</iframe>
This is the important part:
src="http://www.linkedin.com/cws/followcompany?companyIdentifier=568783"
The identifier should match the one you want to offer a follow button for. The remainder of the options were lifted directly from the generated iframe code, so it is mostly unnecessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With