Web system supports multilingual solutions

xiaoxiao2021-03-06  42

The language seen by the web interface exists in a database or resource file. Multi-language systems prohibit all texts that have a specific language type identifier on the page and program code. (Except for comments)

The basic principles of the HTML Data Binding technology are the data source object DSO (Data Source Object) of the displayed data, and the element is used to get the data by binding this data source. Most of the HTML elements, even some ActiveX controls built into IE provide binding features, including A, Button, Div, IMG, Frame, IFRAME, Label, Marquee, SPAN and other tags. About data source objects DSO, usually used with XML tags . The XML tag is only supported by IE5 or later. It features a Data Island to define an XML page on the HTML page, for example: John Smith Visual Notepad Reference Specifies A Data Island The data in XML data island can be easily bound. It is also possible to operate some ActiveXObject with IE. The following mainly introduces the binding of HTML. The two properties used by the binding are DatasRC and DataFld, and DataSRC is used to develop a data source. Such as: Datasrc = "# ometadata" ometadata is the ID of the DSO. Microsoft said that you must add a #, so you must add it, do you want to set it. DataFLD This place is to set a bound field. Such as: datafld = "author"

This displayed in the page is a slightly different binding of the John SmithTML form element. The following is an example of a demonstration:

TestBind.html --------------------- new document </ title> <meta name = "generator" content = "editplus "> <Meta name =" Author "content ="> <meta name = "keywords" content = "> <meta name =" description "content ="> </ head></p> <p><Body> <xml src = xx.xml id = "kk"> </ xml> <input type = "text" name = "fd" DataSRC = "# kk" datafld = "crop"></p> <p><br> <input type = "checkbox" name = "aa" datasrc = "# kk" datafld = "check1" value = 1> <input type = "checkbox" name = "aa" DatasRC = "# kk" datafld = "Check2" value = 2> <input type = "checkbox" name = "aa" Datasrc = "# kk" datafld = "check3" value = 3> <input type = "checkbox" name = "DatasRC =" # KK "DataFld =" Check4 "value = 4> <input type =" checkbox "name =" a "DATASRC =" # kk "DataFld =" check5 "value = 5> <BR> <input type =" radio "name = "b" DATASRC = "# kk" datafld = "Radio" value = 1> <input type = "radio" name = "b" DataSRC = "# kk" datafld = "Radio" value = 2> <input type = " Radio "Name =" b "DATASRC =" # kk "DataFld =" Radio "value = 3> <input type =" Radio "name =" b "Datasrc =" # kk "datafld =" radio "value = 4> < Input type = "radio" name = "b" DATASRC = "# kk" datafld = "radio" value = 5> <input type = "radio" name = "b" DataSRC = "# kk" DataFld = "radio" Value = 6> <input type = "radio" name = "b" Datasrc = "# kk" datafld = "radio" value = 7> <br></p> <p><Select datasrc = "# kk" DataFld = "select"> <option value = 1> S Company </ option> <option value = 2> K Company </ option> <option value = 3> l Company </ option> <option value = 4> J Company </ option> <option value = 5> B Company </ option> <option value = 6> M M company </ option> </ select> <br></p> <p><Textarea name = "" rows = "5" cols = "20" DATASRC = "# kk" datafld = "textarea"> </ textarea> <br> <input type = "reset" DataSRC = "# kk" datafld = "reset" οnclick = "kk.src = 'xx2.xml'> <input type =" reset "DataSRC =" # kk "datafld =" reset "οnclick =" kk.src = 'xx.xml'> < Div datasrc = "# kk" datafld = "div"> </ div></p> <p></ Body> </ html></p> <p>------------------- XML ​​data. XX.XML ----------------------- <? XML Version = "1.0" encoding = "gb2312"?> <root> <row> <crop> 4 </ crop> <name> xxxx </ name> <pass> YYYYY </ pass> <check1> true </ check1> <check2> false </ check2> <check3> true </ check3> <check4> false <CHECK4> FALSE < / Check4> <check5> True </ check5> <radio> 3 </ radio> <select> 3 </ select> <textarea> text content </ textarea> <reset> Binding button </ reset> <DIV> Values ​​in Div </ div> </ row> </ root></p> <p>------------------- XML ​​data. XX2.XML ----------------------- <? XML Version = "1.0" encoding = "gb2312"?> <root> <crop> 5 </ Crop> <name> YYYYYYYYYY </ NAME> <pass> bbbbb </ pass> <check1> false </ check1> <check2> false </ check2> <check3> true </ check3> <check4> false </ check4> <Check5> True </ Check5> <Radio> 5 </ radio> <select> 2 </ select> <textarea> text content 22222 </ textarea> <reset> Binding button 02222 </ reset> < Div> Value within Div 222222222 </ div> </ root> If you do active, you will know the effect. No longer said more.</p> <p>In the company's system, XML data is through each page PageID, querying the database acquisition (/common/getpagelanguageLanguage.aspx) of an XML data stream. The principle is the same as the above example.</p> <p>Demo example download: bind.rar</p> <p>The above is the primary application of HTML data binding technology, more of Microsoft's MSDN information. Reference documentation: http://msdn.microsoft.com/workshop/author/databind/DataConSumer.asp</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-72979.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="72979" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.058</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'T2ExRo1ngVeJyGnRfqzGHB63bwB4VNzBFOpj5mLmILQbS94UbFysfVKvOM8NzC9S1otnsAO7VKpNs2P_2F'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>