I have table that i use to update mysql via ajax or jquery and works for firefox,opera,chrome and safari but not IE8
First off im real new to this and im sure ill use some jargon incorrectly but hopefully youll understand what i mean. Okay i have an HTML table with a set of numbers that gets incremented when you click them then sent to the database. ive been using either this line
$.get('character/statincrease/stat/'+statname);
or this line
sendAjaxRequest('http://www.myfakeurl.com/character/statincrease/stat/'+statname);
in order to send the updated variable to a php handler which in turn updates the mysql database. either line will work flawlessly with mac machine w/ chrome,firefox,safari,and opera and also windows7 machine with chrome but when using the same win7 machine with IE8 the DB is not updated. For the longest i tried a lot of different variations of code for the ajax request and for my variables and nothing has worked. The whole time i was thinking that perhaps IE8 was ignoring the request or somehow parsing the variables in a way the server wasnt understanding however by using fiddler i was able to see that the http request was indeed being executed using IE8. In fact it is getting back a 200 response in both IE8 and chrome however When using IE8 the only difference i could spot was that when using chrome there was an additional client request header that reads
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
and Accept-Language reads with the additional charaacters
en-us,en;q=0.8
as oppsed to IE8
en-us
the responses from the servers were different as well the one when using chrome had a content length of 4568 and content type of
text/html;charset=utf-8
and it looks like a good html page in text view
the response when using IE8 was only 263 long and type was
text/html
it was a small javascript that gave a top.location.href=
My mysql DB is set to utf-8
so im thinking that my php handler is really not setup to take in some href from javascript but handles the html fine thereby it updates the DB?
so could this be what is making the request not update the database in IE8? what is the default charset for http requests in IE8? Can i change my code by inserting a header i开发者_StackOverflow中文版nto the request somehow to make IE8 send it in utf-8? if so how would i modify the xmlhttprequest to do so? Am i totally barking up the wrong tree here?
some friends helped me resolve this issue, unfortunatley the solution is a little over my head to explain but it had something to do with my page being iframed in a page that required a login and even though the function wasnt relying on cookies something to do with IE seeing the cookies that were sent as third party caused IE to invalidate the login session on the upper site
精彩评论