PDA

View Full Version : Ajax turkish character IE6 Problem !!!help me



winpeace
10-13-2007, 10:26 AM
My language is turkish.But it is not work in ie6 ajax.I search goole and I found this code ('text/xml; charset=iso-8859-9')
and add .js file ıt works firefox very well but don't work ie6.Please help me



/*
* Based on Ajax Ticker script (txt file source) (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
*/
var loadingMessage = "Loading news...";
var fetchErrorMessage = "Error loading data...";
var pauseWhenMouseOver = false;
var containerCSSclass = "udc_item";

function getAJAX() {
var httprequest=false
if (window.XMLHttpRequest) {
httprequest = new XMLHttpRequest();
if (httprequest.overrideMimeType) {
httprequest.overrideMimeType('text/xml; charset=iso-8859-9')
}
} else if (window.ActiveXObject) {
try {
httprequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
httprequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
}
}
}
return httprequest;
}

function udcajaxfader (txtfile, divId, divClass, delay, fadeornot) {
this.txtfile = txtfile ;
this.tickerid = divId;
this.delay = delay;
this.isMouseOver = 0;
this.pointer = 0;
this.opacitystring = (typeof fadeornot != "undefined") ? "width:100%;opacity: 1;-moz-opacity:1;filter:progid:DXImageTransform.Microsoft.alpha(opacity=100);" : "";
if (this.opacitystring != "") {
this.delay += 500;
}
this.opacitysetting = 0.2;
this.news = [];
this.ajaxobj = getAJAX()
document.write('<div id="'+divId+'" class="'+divClass+'"><div style="'+this.opacitystring+'">' + loadingMessage + '</div></div>')
this.getXMLfile()
}

udcajaxfader.prototype.getXMLfile = function() {
if (this.ajaxobj) {
var instanceOfTicker = this;
var url = this.txtfile + "?time=" + new Date().getTime();
this.ajaxobj.onreadystatechange =function() {
instanceOfTicker.initialize();
}
this.ajaxobj.open('GET', url, true);
this.ajaxobj.send(null);
}
}

udcajaxfader.prototype.initialize=function() {
if (this.ajaxobj.readyState == 4) {
if (this.ajaxobj.status==200
|| window.location.href.indexOf("http") == -1) {
this.contentdiv = document.getElementById(this.tickerid).firstChild;
var xmldata=this.ajaxobj.responseText;
this.contentdiv.style.display = "none";
this.contentdiv.innerHTML = xmldata;
if (this.contentdiv.getElementsByTagName("div").length==0) {
this.contentdiv.innerHTML = fetchErrorMessage;
return;
}
var instanceOfTicker = this;
document.getElementById(this.tickerid).onmouseover = function(){
instanceOfTicker.isMouseOver=1;
}
document.getElementById(this.tickerid).onmouseout = function() {
instanceOfTicker.isMouseOver=0;
}
if (window.attachEvent) {
window.attachEvent("onunload", function() {
instanceOfTicker.contentdiv = instanceOfTicker.ajaxobj=null;
});
}
for (var i=0; i < this.contentdiv.getElementsByTagName("div").length; i++) {
if (this.contentdiv.getElementsByTagName("div")[i].className == containerCSSclass) { // CSS class
this.news[this.news.length] = this.contentdiv.getElementsByTagName("div")[i].innerHTML;
}
}
this.contentdiv.innerHTML = "";
this.contentdiv.style.display = "block";
this.rotatemsg();
//setTimeout("this.getXMLfile()", 10000);
}
}
}

udcajaxfader.prototype.rotatemsg = function() {
var instanceOfTicker = this;
if (this.isMouseOver == 1 && pauseWhenMouseOver) {
setTimeout(function() {
instanceOfTicker.rotatemsg()
}, 100);
} else {
this.fadetransition("reset");
this.contentdiv.innerHTML = this.news[this.pointer];
this.fadetimer1 = setInterval(function() {
instanceOfTicker.fadetransition('up', 'fadetimer1')
}, 100);
this.pointer=(this.pointer<this.news.length-1)? this.pointer+1 : 0
setTimeout(function() {
instanceOfTicker.rotatemsg();
}, this.delay);
}
}

udcajaxfader.prototype.fadetransition = function(fadetype, timerid) {
var contentdiv=this.contentdiv;
if (fadetype=="reset") {
this.opacitysetting = 0.2;
}
if (contentdiv.filters && contentdiv.filters[0]) {
if (typeof contentdiv.filters[0].opacity == "number") {
contentdiv.filters[0].opacity = this.opacitysetting*100;
} else {
contentdiv.style.filter="alpha(opacity="+this.opacitysetting*100+")";
}
} else if (typeof contentdiv.style.MozOpacity != "undefined" && this.opacitystring != "") {
contentdiv.style.MozOpacity = this.opacitysetting;
} else {
this.opacitysetting = 1;
}
if (fadetype=="up") {
this.opacitysetting += 0.1;
}
if (fadetype=="up" && this.opacitysetting>=1) {
clearInterval(this[timerid]);
}
}



and php file in attachment

djr33
10-13-2007, 10:29 AM
See if this solution will help:
http://www.dynamicdrive.com/forums/showthread.php?t=25591

winpeace
10-13-2007, 10:34 AM
I have fixed it!

Thank you for your help!

I use XAMPP

Solution:
I put
"AddDefaultCharset iso-8859-1"
in httpd-languages.conf

But where is httpd-languages.conf ?

djr33
10-13-2007, 11:02 AM
I suppose that would depend on your server configuration, even whether or not you have the file. I'm not really sure.

winpeace
10-13-2007, 11:09 AM
this is module for joomla.
how solved my problem please help
I am bad english sorry

jscheuer1
10-13-2007, 02:16 PM
httprequest.overrideMimeType isn't available in all browsers.

This solution:



I have fixed it!

Thank you for your help!

I use XAMPP

Solution:
I put
"AddDefaultCharset iso-8859-1"
in httpd-languages.conf

worked for that particular server because the webmaster also owned the server, and because that is how his particular server worked.

Do you own your server? If not, does your host permit you to use .htaccess?


Even though you have the correct encoding on your page, when the server serves the Ajax content, it's using its (the server's) default encoding. There are various ways to change that, for a page, a site, or an entire server. If you have permission to use .htaccess on your host, that is often the easiest method to use for a page, directory, or site. If you own the server, you can change its configuration.

There are other methods besides directly configuring the server, or using the .htaccess (for Apache only).

Resources:

http://www.askapache.com/htaccess/setting-charset-in-htaccess.html

http://dev.mobi/node/207

winpeace
10-13-2007, 05:24 PM
AddDefaultCharset UTF-8
AddCharset UTF-8 .xhtml
AddType 'text/html; charset=UTF-8' html

I add this codes.But don't change anything.Please help

jscheuer1
10-13-2007, 08:14 PM
Well, I thought you wanted:


charset=iso-8859-9

So I think it would be:


AddDefaultCharset iso-8859-9
AddCharset iso-8859-9 .xhtml
AddType 'text/html; charset=iso-8859-9' html

However, this would need to go in the right place and with sufficient permission from the server. Where did you put it?

Also, it looks like you are mixing xhtml and html. Pick the one you are using and stick to that.

winpeace
10-14-2007, 05:55 AM
thank you so much.ıt is working.Have a good day :)