/    Sign up×
Community /Pin to ProfileBookmark

determine page content when creating on the fly form with javascript

Hi
I am creating an on the fly form with javascript .

[CODE]

[COLOR=”Red”] var xml = ‘content is in persian language’;[/COLOR]
var doc = modal.popFrame.contentWindow.document;
var submitForm = doc.createElement(“FORM”);
doc.appendChild(submitForm);
submitForm.method = “POST”;
var newElement = doc.createElement(“<input name=’hdnField’ type=’hidden’>”);
submitForm.appendChild(newElement);
newElement.value =[COLOR=”Red”] xml[/COLOR]
submitForm.action = url;
submitForm.submit();
[/CODE]

the content of xml variable is utf8 format (a language characters other than english)

in server side the characters isn’t utf8 format
how can i convert it to utf8 or any other suggestion please !
thanks

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @sohbati spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...