473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Encoding problem with ajax

abdoelmasry
104 100+
Hi Men

please help me to solve this problem

i have textbox in html page

i require arabic data from php page using method POST with ajax to view in the textbox

i always got a strange sympols in the textbox

although it works fine when view the recieved data in <div>

is this problem with the textbox

i think there is a way to specify data encoding before post it with ajax

im using this code to post data :

[PHP]xmlhttp.open("post",serverpage,true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", datatopost.length);
xmlhttp.setRequestHeader("Connection", "close");[/PHP]
or
should i do some thing to change textbox encoding ?

Greeting
Jul 24 '08 #1
6 2035
gits
5,390 Expert Mod 4TB
that seems quite strange ... the characters appear in different ways in an input-element vs. a normal div? do you have a testpage online where this could be reproducable and where we could have a closer look at? ...

kind regards
Jul 25 '08 #2
abdoelmasry
104 100+
Ok Man

Im Writing Script for Photo Shop

I make my script support Ajax To view data without refresh

here is my page :
http://www.egyhk.com/test/order.php

just click on refresh button and look at the customer name textbox

the arabic characters will be changed to strange Sympols
Jul 26 '08 #3
gits
5,390 Expert Mod 4TB
i tested it with firefox ... and besides a problem with the reference to the 'ordiv'-node in the request's (started in line 47 of the script) callback the response itself seems to be correct ... when i refresh the second time the code seems to work fine? what browser do you use? did you check it with different browsers?

kind regards
Jul 26 '08 #4
abdoelmasry
104 100+
Hey man

Im Using Internet explorer 6
Jul 27 '08 #5
gits
5,390 Expert Mod 4TB
could you try it with firefox too please just to be sure that it work correctly ... as i said it seems to with my firefox here ... just the issue with the first reference to the 'ordiv' node? besides that ... why do you refresh the customer name too? wouldn't it be enough to refresh the prices/positions?

kind regards
Jul 27 '08 #6
abdoelmasry
104 100+
Ok Man

i changed requst metho to GET

I Have No problem now

Thank U Prof
Aug 1 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: smartestdesign | last post by:
I am trying to send request using ajax with some japanese text. As any of you know XMLHttpRequest is send with utf-8. I was hoping there is a way to send with different encoding like var...
2
by: Seguros Catatumbo | last post by:
Hi, i am trying to fill a dropdown menu with ajax, but the table contains latin characters. In mozilla i get a weird black character instead, and in internet explorer the whole code breaks because...
23
by: Allan Ebdrup | last post by:
I hava an ajax web application where i hvae problems with UTF-8 encoding oc chineese chars. My Ajax webapplication runs in a HTML page that is UTF-8 Encoded. I copy and paste some chineese chars...
3
by: sandeepmassey | last post by:
I am trying to develop an AJAX styled CMS, using Windows XP, IIS, PHP5 and MySQL5. I wish to upload image files to the MySQL database by using the XMLHttpRequest object. Please help me as to how I...
3
by: praveen2gupta | last post by:
I am using ajax in my application. I wants to apply encoding for the receiving data. I have applied it as follows. if (window.XMLHttpRequest) { http = new XMLHttpRequest();...
3
by: farukcse | last post by:
Dear Sir, i am facing a problem with encoding for arabic characters. here is the code: 1.test.html &lt;html&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; var AJAX = { initialize:...
3
by: paitoon | last post by:
Hello I have problem with ajax encoding in IE,(I use Thai language ) I use a form that people will send email to me to my Hotmail via ajax engine. I test with firefox and opera everything work...
1
by: shaunwo | last post by:
I'm an AJAX / DOM Novice (at best) and trying to figure out how to write the value to a couple input fields. I don't remember exactly where I got the ajax.js file I'm using from (went to the website...
2
by: Gene | last post by:
Hi, I have problem with X-JSON. I am sending, in header, Polish chars, that are correct encoded in database, but when they came through header something wrong happen with encoding and I can only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.