Skip to content

Commit

Permalink
fix for a IE8 bug where if an ajax request is made to a URL with an a…
Browse files Browse the repository at this point in the history
…nchor on it and before that anchor is a query string eg. ?view=small#bottom, the result is as the request is processed PHP says in the query string view equals small#bottom. Anchors can end up in the request URL because many ajax requests use the current location as the request URL which can include an anchor. Also making the request to an anchored URL doesn't make sense. Where this has come out as a definate bug is on the login screen when you have no session and are authenticating. If you have a hash tag there and are using IE8 the browser version query string param gets polluted and CMS says your browser is not supported. That version gets locked in your session and the only way to break out of that is clear your cookies.

git-svn-id: http://public-cvs.squiz.net/svn/squiz-framework@1134 1b08cf3a-d8dc-418b-9366-0d0b919357ef
  • Loading branch information
achadszinow committed Nov 22, 2010
1 parent 4eb6e31 commit bb0cb00
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Systems/GUI/Web/DfxJSLib/ajax.js
Expand Up @@ -27,13 +27,21 @@ if (!window.dfx) {

dfx.get = function(url, data, callBack)
{
// No ajax requests should have an anchor part in the URL.
// Also IE8 bug - Anchor becomes part of last query string value.
alert('request URL ' + url);
url = dfx.noAnchorPartUrl(url);
alert('request URL2 ' + url);
jQuery.get(url, data, callBack);

};


dfx.post = function(url, data, successCallback, errorCallback, timeout)
{
// No ajax requests should have an anchor part in the URL.
// Also IE8 bug - Anchor becomes part of last query string value.
url = dfx.noAnchorPartUrl(url);
timeout = timeout || 20;
jQuery.ajax({
url: url,
Expand All @@ -55,6 +63,9 @@ dfx.post = function(url, data, successCallback, errorCallback, timeout)
*/
dfx.getJSON = function(url, data, callBack)
{
// No ajax requests should have an anchor part in the URL.
// Also IE8 bug - Anchor becomes part of last query string value.
url = dfx.noAnchorPartUrl(url);
jQuery.getJSON(url, data, callBack);

};
Expand Down

0 comments on commit bb0cb00

Please sign in to comment.