devote / HTML5-History-API

HTML5 History API expansion for browsers not supporting pushState, replaceState
http://spb-piksel.ru
MIT License
1.02k stars 182 forks source link

duplicate URL by IE #27

Closed Abu-Taymiyyah closed 10 years ago

Abu-Taymiyyah commented 11 years ago

Hy,

The problem is, that when the url is: http://...../?s=test/ and then i clicked on a filter, then must the url are ?s=test&order=asc, what in mozilla and other browsers works, but in ie its not work. Here are the urls duplicated like so:

?s=test/?s=test&order=asc

    nohttp   = url.replace("http://","").replace("https://","");
    firstsla = nohttp.indexOf("/");
    pathpos  = url.indexOf(nohttp);
    path     = url.substring(pathpos + firstsla);

    if (push != 1) {
        var stateObj = { foo: 1000 + Math.random()*1001 };

            history.pushState(stateObj, null , path);   

    }
devote commented 11 years ago

Hi,

I was not able to reproduce this problem. Maybe I'm doing something wrong, give an example of a more precise.

Thank you!

Abu-Taymiyyah commented 11 years ago

Hy,

Here is a live example of this Site, then click on the dropdown or the asc desc option:

http://www.test.at-tanzil.de/?s=test+lorem+consetetur

In Firefox, Chrome, Safari and IE10 its works, but in ie9, ie8 and ie7 it duplicate the url.

Thanks.

devote commented 11 years ago

Please update to version 4.0.1 of the library.

Then connect it like this:

<script type="text/javascript" src="http://test.at-tanzil.de/wp-content/themes/Repra/assets/js/history.js?ver=4.0.1&redirect=true&basepath=/"></script>
Abu-Taymiyyah commented 11 years ago

Thank You!!! Very good support!

devote commented 11 years ago

and use the special property for HTML4 browsers

window.onpopstate = function(event) {
    if (event.state != undefined) {
        loadPage((history.location || document.location).href, 1);
    }
};
Abu-Taymiyyah commented 11 years ago

So i have added the uptaded Version but yet its not work.

When one call the url then its redirct to:

http://test.at-tanzil.de/#/?s=test

And without the redirect=true&basepath=/ is like before.

Is something on my javascript wrong?

devote commented 11 years ago

Is something on my javascript wrong?

By all appearances is something wrong, now I will try to look.

devote commented 11 years ago

Why you use this plug-in with my library? http://test.at-tanzil.de/wp-content/plugins/pushstate/jquery.history.js?ver=3.5.1

Abu-Taymiyyah commented 11 years ago

Oh no, i have only tried that maybe it's lies on WordPress. Do not have much experience with Ajax sry, it was disabled.

devote commented 11 years ago

Turn off all unnecessary.

And connect history.js before the other scripts.

Abu-Taymiyyah commented 11 years ago

Sry Have tried that because i read that this is specific for wordpress. it was disabled.

Abu-Taymiyyah commented 11 years ago

Ok now are only Jquery, History and the Ajax Request online.

devote commented 11 years ago

Add please parameters redirect=true&basepath=/ for testing. Thanks!

Abu-Taymiyyah commented 11 years ago

Added!

devote commented 11 years ago

Thanks, I found the reason. Your server redirect from http://www.test.at-tanzil.de/ to http://test.at-tanzil.de/ and at that address your site is down, here's the problem.

Disable redirect on the server

devote commented 11 years ago

http://test.at-tanzil.de/?s=test+lorem+consetetur&order=desc - your site is work fine http://test.at-tanzil.de/ - your site is down (or inconsistent content)

Abu-Taymiyyah commented 11 years ago

The Mainpage test.at-tanzil.de is empty because i have no content on there. When i insert content on there, then its works also, here look: http://test.at-tanzil.de/

devote commented 11 years ago

You need to make a one-page site, where the data should always get through AJAX. Then be good to work with.

devote commented 11 years ago

I have to go now. You still think about the solution of the problem. And when I get back, I'll try to help you any way I can.

devote commented 11 years ago

Hi

You have solved the problem?

Abu-Taymiyyah commented 11 years ago

Hi,

No unfortunately not, as I had little time during the week I wanted to dedicate this issue in detail at the weekend. Tomorrow i tell you if i could solve this problem.

devote commented 10 years ago

I close this issue, if you still want to solve this, let me know. Thank you