开发者

how to show arabic alert from left to right

开发者 https://www.devze.com 2022-12-18 06:55 出处:网络
How to show java script alert of arabic characters/text f开发者_开发知识库rom ltr(Left to right) format.In html we have ltr tag.This is largely operating system dependent.Simply reversing the string i

How to show java script alert of arabic characters/text f开发者_开发知识库rom ltr(Left to right) format.In html we have ltr tag.


This is largely operating system dependent. Simply reversing the string is not 100% correct, since this does not render punctuation correctly.

If you need 100% locale independence in the browser, I would suggest using an HTML dialog, like jQuery UI, instead of alert().


You can't do it using the regular javascript alert()

however, you can use some custom javascript alert box (you can use HTML inside it)

some like this http://slayeroffice.com/code/custom_alert/ or http://jdstiles.com/java/jsalert.html


Hi, this is possible using unicode control characters:
- variable 'g' without ucc

var g="أكتب تعليقا!\nWrite a comment!\n";
  • variable 'g' with ucc
var g="‫أكتب تعليقا!\n‪Write a comment!\n";

or

var g="‫أكتب تعليقا!\n‪Write a comment!\n";

simply: place (LRE) character (‪‪‪) in multi-dir texts where embedded texts start from left-to-right; place (RLE) character (‫) in multi-dir texts where embedded texts start from right-to-left.

or on your win notepad right click where embedded text start, insert unicode..., (LRE) or (RLE)

0

精彩评论

暂无评论...
验证码 换一张
取 消