搜索词>>ie9 耗时0.0530
  • ie9 jquery ajax跨域问题解决

    ie9 jquery ajax跨域问题解决, ajax ie9 跨域问题解决,jquery,ajax,ie9<strong><img alt="IE9" class="img-thumbnail" src="/assist/images/blog/a177036b22b4400e9adf48b25e574615.png" /><br /> 描述</strong><br /> ie9 jquery ajax跨域问题<br /> <br /> <strong>解决步骤</strong> <h2>一.导入相关文件</h2> 导入需要的jquery依赖文件,这里用的jquery的1.x版本 <pre> <code class="language-javascript"><!-- jQuery引入 --> <script type="text/javascript" src="../libs/jQuery/jquery.js"></script></code></pre> <h2>二.设置IE浏览器支持跨域访问</h2> <strong>2.1打开IE浏览器,选择设置里面的intelnet选项,如下图:</strong><br /> <img alt="IE浏览器 intelnet选项" class="img-thumbnail" src="/assist/images/blog/4e7c330e6ffc49b2bb181f700d641ad4.png" /><br /> <strong>2.2选择intelnet选项面板中的安全模块,并点击自定义级别,如下图</strong><br /> <img alt="intelnet选项面板中的安全模块" class="img-thumbnail" src="/assist/images/blog/4d397e7dfd1e480c9aacb4c44b912f27.png" /><br /> <strong>2.3找到通过遇访问数据源,选择启用,如图:<br /> <img alt="找到通过遇访问数据源,选择启用" class="img-thumbnail" src="/assist/images/blog/c100d8f866764a918a195f2f44690848.png" /></strong> <h2>三.编写一个jquery的ajax请求demo</h2> <pre> <code class="language-html"><!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>jquery IE9 跨域问题解决</title> </head> <body> <!-- jQuery引入 --> <script type="text/javascript" src="../libs/jQuery/jquery.js"></script> <script type="text/javascript"> $(function() { $.ajax({ url:'http://localhost:8080/test.do', type:'GET', crossDomain: true == !(document.all), processData: false, success:function(data){ alert(data); }, error: function(jqXHR,err) { alert(jqXHR.status+": "+jqXHR.statusText); } }); }) </script> </body> </html></code></pre> <br /> 运行:<br /> <img alt="运行结果" class="img-thumbnail" src="/assist/images/blog/aaa3f74ed2d6478aa6a8633c6c52b3b6.png" /><br /> <br /> 服务代码:这里是java提供的测试访问: <pre> <code class="language-java"> @GetMapping("test.do") @ResponseBody public String test(HttpServletResponse response){ response.setHeader("Access-Control-Allow-Methods", "POST, PUT, GET, OPTIONS, DELETE"); response.setHeader("Access-Control-Allow-Origin", "*"); return "Hello Form Server"; }</code></pre> <br />  
  • IE9 jQuery ajax文件上传兼容问题解决

    IE9 jQuery ajax文件上传兼容问题解决。主要通过jQuery的jquery.form插件解决的IE9不支持formData的文件上传问题。<h2>1.准备</h2> 下载jQuery1.x版本(测试用v1.12.4)<br /> 下载jQuery的form插件(<a href="http://plugins.jquery.com/form/" rel="external nofollow" target="_blank">下载地址</a>)<br /> 本例子是通过Java后端进行测试的,后端为spring boot框架 <h2>2.后端代码</h2> 1测试的controller代码 <pre> <code class="language-java">package com.example; import javax.servlet.http.HttpServletResponse; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; @Controller public class TestController { @GetMapping(value = { "/", "/index.html" }) public Object index() { return new ModelAndView("index"); } @PostMapping(value = { "/fileupload.do" }, produces = { "text/html;charset=UTF-8" }) @ResponseBody public Object fileUpload(String name, MultipartFile file) { try { if (file.getBytes().length > 0) { return "{\"message\":\"success\",\"name\":\"" + name + "\"}"; } else { return "{\"message\":\"fail\"}"; } } catch (Exception e) { throw new RuntimeException("文件上传异常"); } } @PostMapping(value = { "/fileupload2.do" }/*, produces = { "text/html;charset=UTF-8" }*/) public void fileUpload2(String name, MultipartFile file,HttpServletResponse response) { try { if (file.getBytes().length > 0) { response.setContentType(""); response.setHeader("Content-Type", "text/html;charset=UTF-8"); response.getWriter().write("{\"message\":\"success\",\"name\":\"" + name + "\"}"); } else { response.setHeader("Content-Type", "text/html;charset=UTF-8"); response.getWriter().write("{\"message\":\"fail\"}"); } } catch (Exception e) { throw new RuntimeException("文件上传异常"); } } } </code></pre> <span style="color:#e74c3c">注意:上面的第一种写法<strong>produces = { "text/html;charset=UTF-8" }</strong>必须这样写,其他写法则会出现各种问题</span> <p> </p> <h2>3.后端代码</h2> 1HTML页面代码 <pre> <code class="language-html"><!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"/> <title>测试</title> </head> <body> <form method="post" enctype="multipart/form-data" id="upload-form"> <input type="text" name="name" /> <input type="file" name="file"/> </form> <button type="button" id="btn-upload">上传测试</button> <script type="text/javascript" src="/libs/jquery.min.js"></script> <script type="text/javascript" src="/libs/jquery.form.js"></script> <script type="text/javascript" src="/libs/index.js"></script> </body> </html></code></pre> <br /> 2.index.js文件代码 <pre> <code class="language-javascript">/** * */ $(function() { $('#btn-upload').click(function(){ var options = { url : "/fileupload.do", success : function(data) { var returnData = JSON.parse(data); alert(data); }, resetForm : true, }; $("#upload-form").ajaxSubmit(options); }) })</code></pre> <h2>4jQuery form控件API</h2> <h2>Options</h2> <p><strong>Note:</strong> All standard <a href="http://api.jquery.com/jQuery.ajax" rel="external nofollow" target="_blank">$.ajax</a> options can be used.</p> <h3>beforeSerialize</h3> <p>Callback function invoked prior to form serialization. Provides an opportunity to manipulate the form before its values are retrieved. Returning <code>false</code> from the callback will prevent the form from being submitted. The callback is invoked with two arguments: the jQuery wrapped form object and the options object.</p> <pre> <code class="language-javascript">beforeSerialize: function($form, options) { // return false to cancel submit }</code></pre> <h3>beforeSubmit</h3> <p>Callback function invoked prior to form submission. Returning <code>false</code> from the callback will prevent the form from being submitted. The callback is invoked with three arguments: the form data in array format, the jQuery wrapped form object, and the options object.</p> <pre> <code class="language-javascript">beforeSubmit: function(arr, $form, options) { // form data array is an array of objects with name and value properties // [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] // return false to cancel submit }</code></pre> <h3>filtering</h3> <p>Callback function invoked before processing fields. This provides a way to filter elements.</p> <pre> <code class="language-javascript">filtering: function(el, index) { if ( !$(el).hasClass('ignore') ) { return el; } }</code></pre> <h3>clearForm</h3> <p>Boolean flag indicating whether the form should be cleared if the submit is successful</p> <h3>data</h3> <p>An object containing extra data that should be submitted along with the form.</p> <pre> <code>data: { key1: 'value1', key2: 'value2' } </code></pre> <h3>dataType</h3> <p>Expected data type of the response. One of: null, 'xml', 'script', or 'json'. The dataType option provides a means for specifying how the server response should be handled. This maps directly to jQuery's dataType method. The following values are supported:</p> <ul> <li>'xml': server response is treated as XML and the 'success' callback method, if specified, will be passed the responseXML value</li> <li>'json': server response will be evaluted and passed to the 'success' callback, if specified</li> <li>'script': server response is evaluated in the global context</li> </ul> <h3>delegation</h3> <p>true to enable support for event delegation <em>requires jQuery v1.7+</em></p> <pre> <code class="language-javascript">// prepare all existing and future forms for ajax submission $('form').ajaxForm({ delegation: true });</code></pre> <h3>error</h3> <p>Callback function to be invoked upon error.</p> <h3>forceSync</h3> <p>Only applicable when explicity using the iframe option or when uploading files on browses that don't support XHR2. Set to <code>true</code> to remove the short delay before posting form when uploading files. The delay is used to allow the browser to render DOM updates prior to performing a native form submit. This improves usability when displaying notifications to the user, such as "Please Wait..."</p> <h3>iframe</h3> <p>Boolean flag indicating whether the form should <em>always</em> target the server response to an iframe instead of leveraging XHR when possible.</p> <h3>iframeSrc</h3> <p>String value that should be used for the iframe's src attribute when an iframe is used.</p> <h3>iframeTarget</h3> <p>Identifies the iframe element to be used as the response target for file uploads. By default, the plugin will create a temporary iframe element to capture the response when uploading files. This options allows you to use an existing iframe if you wish. When using this option the plugin will make no attempt at handling the response from the server.</p> <h3>method</h3> <p>The HTTP method to use for the request (e.g. 'POST', 'GET', 'PUT').</p> <h3>replaceTarget</h3> <p>Optionally used along with the the target option. Set to true if the target should be replaced or false if only the target contents should be replaced.</p> <h3>resetForm</h3> <p>Boolean flag indicating whether the form should be reset if the submit is successful</p> <h3>semantic</h3> <p>Boolean flag indicating whether data must be submitted in strict semantic order (slower). Note that the normal form serialization is done in semantic order with the exception of input elements of <code>type="image"</code>. You should only set the semantic option to true if your server has strict semantic requirements and your form contains an input element of <code>type="image"</code>.</p> <h3>success</h3> <p>Callback function to be invoked after the form has been submitted. If a 'success' callback function is provided it is invoked after the response has been returned from the server. It is passed the following standard jQuery arguments:</p> <ol> <li><code>data</code>, formatted according to the dataType parameter or the dataFilter callback function, if specified</li> <li><code>textStatus</code>, string</li> <li><code>jqXHR</code>, object</li> <li><code>$form</code> jQuery object containing form element</li> </ol> <h3>target</h3> <p>Identifies the element(s) in the page to be updated with the server response. This value may be specified as a jQuery selection string, a jQuery object, or a DOM element.</p> <h3>type</h3> <p>The HTTP method to use for the request (e.g. 'POST', 'GET', 'PUT').<br /> An alias for <code>method</code> option. Overridden by the <code>method</code> value if both are present.</p> <h3>uploadProgress</h3> <p>Callback function to be invoked with upload progress information (if supported by the browser). The callback is passed the following arguments:</p> <ol> <li>event; the browser event</li> <li>position (integer)</li> <li>total (integer)</li> <li>percentComplete (integer)</li> </ol> <h3>url</h3> <p>URL to which the form data will be submitted.</p> <hr /> <h2>Utility Methods</h2> <h3>formSerialize</h3> <p>Serializes the form into a query string. This method will return a string in the format: <code>name1=value1&name2=value2</code></p> <pre> <code>var queryString = $('#myFormId').formSerialize();</code></pre> <h3>fieldSerialize</h3> <p>Serializes field elements into a query string. This is handy when you need to serialize only part of a form. This method will return a string in the format: <code>name1=value1&name2=value2</code></p> <pre> <code>var queryString = $('#myFormId .specialFields').fieldSerialize();</code></pre> <h3>fieldValue</h3> <p>Returns the value(s) of the element(s) in the matched set in an array. This method always returns an array. If no valid value can be determined the array will be empty, otherwise it will contain one or more values.</p> <h3>resetForm</h3> <p>Resets the form to its original state by invoking the form element's native DOM method.</p> <h3>clearForm</h3> <p>Clears the form elements. This method emptys all of the text inputs, password inputs and textarea elements, clears the selection in any select elements, and unchecks all radio and checkbox inputs. It does <em>not</em> clear hidden field values.</p> <h3>clearFields</h3> <p>Clears selected field elements. This is handy when you need to clear only a part of the form.</p> <hr /> <h2>File Uploads</h2> <p>The Form Plugin supports use of XMLHttpRequest Level 2 and <a href="https://developer.mozilla.org/en/XMLHttpRequest/FormData" rel="external nofollow" target="_blank">FormData</a> objects on browsers that support these features. As of today (March 2012) that includes Chrome, Safari, and Firefox. On these browsers (and future Opera and IE10) files uploads will occur seamlessly through the XHR object and progress updates are available as the upload proceeds. For older browsers, a fallback technology is used which involves iframes. <a href="http://malsup.com/jquery/form/#file-upload" rel="external nofollow" target="_blank">More Info</a></p>
  • windows7/win7如何把IE9/IE11恢复到IE8

    前言在写这篇文章前,我百度了很多教程,大多数都是相似的,结果都是失败前言在写这篇文章前,我百度了很多教程,大多数都是相似的,结果都是失败。失败的结果导致IE卸载了装不上。尴尬的只有重装系统。​本文主要是针对互联网上千篇一律的错误win7 IE9/IE11恢复到IE8进行纠正并记录详细操作步骤。​​​​​​​​win7 恢复IE8步骤1:首先关闭IE x(x代表IE 版本IE9/IE10/IE11)​点击计算机属性,得到下面:​点击控制面板得到下面:​点击上方的卸载程序得到下面界面:​点击打开或关闭Windows功能,得到下面界面​将上图中的internet Explorer 9前面的复选框 钩 去掉,再点击确定​关闭IE 浏览器​到此步骤一完毕。步骤二:卸载IE9(IE高版本)首先我们到程序卸载的界面​点击查看已安装的更新,得到下面界面:​重上方界面中找到IE9(高版本IE),并卸载,这里有语言包和IE程序,优先卸载语言包,再卸载程序​卸载后需要重启,点击立即重启即可。至此,步骤二卸载完成;步骤三:启用IE8步骤二重启系统后,我们先进入程序卸载界面​我看可以看到下面的​上图中点Internet Explorer8 前面的复选框,然后点击确定进行启用IE8​提示重启,重启即可这时候开机我们将得到一个IE8​​​
  • Spring mvc文件下载IE/Edge中文乱码解决

    Spring mvc文件下载IE/Edge中文乱码解决,在spring mvc项目开发中,我们可能经常遇到文件的上传和下载操作。这里将讲解在IE/Edge浏览器中文件下载中文乱码的解决方法。<h2>引言</h2>     在spring mvc项目开发中,我们可能经常遇到文件的上传和下载操作。这里将讲解在IE/Edge浏览器中文件下载中文乱码的解决方法。 <h2>一.解决spring mvc IE/Edge浏览器乱码</h2> 编写controller测试代码: <pre> <code class="language-java">package net.xqlee.project.controller; import java.net.URLEncoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class FileController { /** * 文件下载 * * @param request * @param response */ @GetMapping("download.do") public void downloadFile(HttpServletRequest request, HttpServletResponse response) { try { String fileName = "中文测试.DAT"; response.getWriter().write("中文测试你好"); fileName = dealFileName(request, fileName); response.addHeader("Content-Disposition", "attachment;filename=" + fileName); } catch (Exception e) { e.printStackTrace();// logger } } /** * 处理IE/Edge(win10)浏览器中文乱码 * * @param request * @param fileName * @return */ public String dealFileName(HttpServletRequest request, String fileName) { try { String codeFileName = ""; String agent = request.getHeader("User-Agent"); if (agent == null) { return fileName; } agent = agent.toUpperCase(); if (null == agent) { codeFileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1"); } else if (-1 != agent.indexOf("MSIE") || -1 != agent.indexOf("TRIDENT") || -1 != agent.indexOf("EDGE")) { codeFileName = URLEncoder.encode(fileName, "UTF-8"); } else { codeFileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1"); } return codeFileName; } catch (Exception e) { e.printStackTrace();// logger return fileName; } } } </code></pre> <br /> 注意观察上面的代码,解决乱码主要在dealFilename();这个方法中进行处理的。FileName进行get UTF8字符集是因为当前代码的编码格式为UTF-8如果是GBK则更改为GBK<br /> <br /> 二.测试IE/Edge浏览器中文乱码的解决 <h3>2.1启动刚才controller所在的项目。</h3> <h3>2.2访问文件下载地址查看结果</h3> 文件下载地址为:http://localhost:8080/download.do<br /> <br /> 观察IE浏览器:<br /> <img alt="Spring MVC IE浏览器乱码解决测试结果" class="img-thumbnail" src="/assist/images/blog/57cdaf3f0eca43ba8934d277eda4e82a.png" /><br /> <br /> 从上图可以看到中文已经正常显示。接下来测试win10的Edge浏览器:<br /> <img alt="Spring MVC Edge浏览器乱码解决测试结果" class="img-thumbnail" src="/assist/images/blog/6c691febe79746d3a742b487b00efb84.png" />从上图也能看到中午呢乱码问题已经得到解决。<br />  
  • Java 9 模块化编程

    Java 9 模块化编程Java9 模块化编程
  • Java 9 紧凑String改进[JEP 254]Java9新特性

    Java 9 紧凑String改进[JEP 254],Java9新特性<p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff">    在Java 8中,Java中的<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html" rel="external nofollow" style="box-sizing:border-box; transition:all 0.1s ease-in-out; color:#0366d6; text-decoration:none" target="_blank">String</a>由内部表示<code>char[]</code>。每个<code>char</code>存储在内存中的2个字节中。oracle的JDK开发人员分析了大量客户端的应用程序堆转储,他们注意到大多数字符串只能使用<a href="https://cs.stanford.edu/~miles/iso8859.html" rel="external nofollow" style="box-sizing:border-box; transition:all 0.1s ease-in-out; color:#0366d6; text-decoration:none" target="_blank">拉丁-1字符集表示</a>。拉丁字符1可以存储在一个字节中,比<code>char</code>数据类型存储少50%(1个字节)。</span></span></span></p> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff">    因此,JDK开发者默认将<code>String</code>类内部存储设置为<code>byte[]</code>from <code>char[]</code>。这导致在堆内存中节省大量空间,因为通常,字符串对象占据堆内存的很大一部分。[ <a href="http://cr.openjdk.java.net/~shade/density/state-of-string-density-v1.txt" rel="external nofollow" style="box-sizing:border-box; transition:all 0.1s ease-in-out; color:#0366d6; text-decoration:none" target="_blank">来源</a> ]</span></span></span></p> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff">您可以使用<code>-XX:-CompactStrings</code>参数<code>java</code>命令来控制应用程序中此功能的使用。</span></span></span><br /> <br />  </p> <h2 style="margin-left:0px; margin-right:0px; text-align:start">Java 9之前的字符串类(String)</h2> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff">在Java 9之前,字符串数据被存储为一个字符数组。这需要每个字符16位。</span></span></span></p> <pre> <code class="language-java">public final class String implements java.io.Serializable, Comparable<String>, CharSequence { //The value is used for character storage. private final char value[]; }</code></pre> <p style="margin-left:0px; margin-right:0px; text-align:start"> </p> <h2 style="margin-left:0px; margin-right:0px; text-align:start">Java 9之后的字符串类(String)</h2> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff">从Java 9开始,字符串现在在内部使用字节数组以及用于编码引用的标志字段来表示。</span></span></span></p> <pre> <code class="language-java">public final class String implements java.io.Serializable, Comparable<String>, CharSequence { /** The value is used for character storage. */ @Stable private final byte[] value; /** * The identifier of the encoding used to encode the bytes in * {@code value}. The supported values in this implementation are * * LATIN1 * UTF16 * * @implNote This field is trusted by the VM, and is a subject to * constant folding if String instance is constant. Overwriting this * field after construction will cause problems. */ private final byte coder; }</code></pre> <h2 style="margin-left:0px; margin-right:0px; text-align:start">'java'命令参考</h2> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff">我们知道该<code>java</code>命令用于启动Java应用程序。它可以有许多参数来定制应用程序运行时。一个这样的命令如下:</span></span></span></p> <h4 style="margin-left:0px; margin-right:0px; text-align:start">-XX:-CompactStrings</h4> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff"><strong>禁用紧凑字符串功能</strong>。默认情况下,此选项已启用。启用此选项时,仅包含单字节字符的Java字符串将在内部表示,并使用ISO-8859-1 / Latin-1编码以单字节字符串的形式存储。这使得只包含单字节字符的字符串所需的空间量减少了50%。对于包含至少一个多字节字符的Java字符串:使用UTF-16编码将这些字符表示并存储为每个字符2个字节。<strong>禁用紧凑字符串功能强制使用UTF-16编码</strong>作为所有Java字符串的内部表示。</span></span></span></p> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff">禁用紧凑字符串可能有益的情况包括:</span></span></span></p> <ol> <li style="list-style-type:decimal">当知道一个应用程序压倒多数将分配多字节字符串</li> <li style="list-style-type:decimal">在从Java SE 8迁移到Java SE 9时观察到性能回退的意外事件中,分析显示Compact Strings引入了回归</li> </ol> <p style="margin-left:0px; margin-right:0px; text-align:start"><span style="color:#333333"><span style="font-family:"varela round","helvetica neue",Helvetica,Arial,sans-serif"><span style="background-color:#ffffff">在这两种情况下,禁用紧凑字符串都是有道理的。</span></span></span></p> <blockquote> <p style="margin-left:0px; margin-right:0px; text-align:start">提示:这纯粹是一个实现变化,没有改变现有的公共接口。</p> </blockquote> <p style="margin-left:0px; margin-right:0px; text-align:start"> </p>
  • bootstrap-select ajax动态添加值中遇到的IE兼容问题解决

    bootstrap-select ajax动态添加值中遇到的IE兼容问题解决bootstrap-select ajax动态添加值中遇到的IE兼容问题解决<br /> <br /> 1.不兼容IE浏览器的方式 <pre> <code class="language-javascript">$(function{ $.ajax({ url:'your request url', type:'GET', success:function(data){ //通过data组装options var options=''; $.each(data.arr,function(index,element){ options+='<option value="'+element.id+'">'+element.value+'</option>'; }) $('#you-select-id').append(options); $('#you-select-id').selectpicker({ style: 'btn-default', noneSelectedText:'请选择', liveSearch:true, size:6,//下拉时候超过6个设置滚动条,默认显示所有 }); $('#you-select-id').selectpicker('refresh'); } }); })</code></pre> <br /> 2.兼容IE浏览器的方式 <pre> <code class="language-javascript">$(function{ $('#you-select-id').selectpicker({ style: 'btn-default', noneSelectedText:'请选择', liveSearch:true, size:6,//下拉时候超过6个设置滚动条,默认显示所有 }); $.ajax({ url:'your request url', type:'GET', success:function(data){ //通过data组装options var options=''; $.each(data.arr,function(index,element){ options+='<option value="'+element.id+'">'+element.value+'</option>'; }) $('#you-select-id').append(options); $('#you-select-id').selectpicker('refresh'); } }); })</code></pre>  
  • DbVisualizer常见问题Q&A

    DbVisualizer9.5.7软件的激活,DbVisualizer9.5.7中文乱码处理等一些列Q&A,DbVisualizer,DbVisualizer9中文乱码,DbVisualizer常见问题<p><strong>Q:DbVisualizer9.5.7绿色版下载</strong></p> <p><strong>A</strong>:本站分享一个供大家学习交流的绿色版本,百度网盘: http://pan.baidu.com/s/1eSlFCu2 密码: 32kj</p> <p><strong>Q:DbVisualizer中文乱码怎么解决?</strong></p> <p><strong>A</strong>:<br /> 中文乱码的主要原因:<br /> DbVisualizer软件默认设置的字体不包含中文,所以在使用的时候会出现 SQL查询语句的中文乱码,查询结果的中文乱码。<br /> <br /> 解决<strong>DbVisualizer中文乱码步骤</strong>:</p> 1.打开DbVisualizer,点击菜单Tools->Tool Properties... <p><img alt="打开菜单1" class="img-thumbnail" src="/assist/images/blog/796d61b547e942eb8e4ea9f258e5ac75.png" /></p> 2.点 击General->Appearance->Fonts,将下图左边的三个字体改为中文字体格式,这里我改成的仿宋体 <p><img alt="DbVisualizer9.5.7修改中文字体" class="img-thumbnail" src="/assist/images/blog/e410958f5ca443e59309e5a595c94a5b.png" /><br /> 修改完成后点击Apply并点击OK,会提示重启软件,如果当前没有重要的文件操作就重启软件打开后就会支持中文啦。<br /> <br /> <strong>Q:已经安装上述方法设置字符集但是使用SQL查询的时候中文出现问题或者说中文不起效果怎么办?数据库在Linux上使用的UTF-8字符集,本地是window系统</strong><br /> <br /> <strong>A:</strong><br /> 情况分析:<br /> 导致这种情况发生首先查看本地window系统的默认字符集,一般情况下Windows的默认字符集为GBK或者GB系列。在DbVisualizer采用Server Info类型链接的时候会默认获取当前系统的字符集。也就是GBK系列,然后和服务器那边的数据字符集UTF8不一致导致中文无法被正确解析。<br /> 解决方法:<br /> 1.更换链接方式,采用Database URL方式链接<br /> 2.在url链接的url中指定字符集<br /> <img alt="指定链接方式URL" class="img-thumbnail" src="/assist/images/blog/fec0ecbdf118460ca28af004d1361be8.png" /><br /> <br /> <strong>Q:DbVisualizer9如何设置SQL自动补全?<br /> A:</strong><br /> 1.打开DbVisualizer9工具<br /> 2.依次选择Tools->Tool Properties...->SQL Commonder->Auto Completion设置信息如下图所示<br /> <img alt="自动补全设置" class="img-thumbnail" src="/assist/images/blog/f34eab52cd5641e0b8595c9ee6dfffe3.png" /><br /> <br /> <strong>Q:如何去掉自动补全前面的数据库名称或者Schema名?<br /> A:</strong><br /> 1.打开DbVisualizer9工具<br /> 2.依次选择Tools->Tool Properties...->Databases<br /> 找到自己使用的数据库,点开,例如下图设置的MySQL数据库<br /> <img alt="设置自动补全的数据库名不显示" class="img-thumbnail" src="/assist/images/blog/5c4d4481d068432d85c465f44632e2af.png" /><br /> <br /> <br /> DbVisualizer 10.0发布啦<a rel="" target="_blank"href="http://www.leftso.com/blog/256.html" rel="external nofollow" target="_blank">http://www.leftso.com/blog/256.html</a><br />  </p>
  • console对象对IE浏览器/谷歌浏览器/火狐浏览器/Opera浏览器支持情况

    这里主要讲解下在前端开发中常用的调试日志对象console。console对象对目前国内流行的浏览器如:IE/谷歌/火狐的支持情况说明<ul> <li> <h2>1.IE浏览器中的console支持以下几种输出</h2> <pre> <code class="language-html">log info warn error assert dir clear profile profileEnd </code></pre> </li> <li> <h2>2.火狐浏览器</h2> <pre> <code class="language-html">log info warn error debug exception assert dir dirxml trace group groupEnd groupCollapsed time timeEnd profile profileEnd count clear table notifyFirebug firebug </code></pre> </li> <li> <h2>3.谷歌浏览器</h2> <pre> <code class="language-html">profiles memory debug error info log warn dir dirxml trace assert count markTimeline profile profileEnd time timeEnd group groupCollapsed groupEnd </code></pre> </li> <li> <h2>4.Opera浏览器</h2> <pre> <code class="language-html">time timeEnd trace profile profileEnd debug log info warn error assert dir dirxml group groupCollapsed groupEnd count table</code></pre> </li> </ul> <h2>总结:</h2> 四种浏览器对常用的<em><strong>log、info、warn、error</strong></em>四个基本方法都是支持的
  • centos 6.9minimal版本安装桌面窗口X Window

    安装系统时候为了快速安装采取centos 6.9minimal版本,偶尔需要使用窗口桌面这里讲解如何安装安装系统时候为了快速安装采取centos 6.9minimal版本,偶尔需要使用窗口桌面这里讲解如何在线安装<br /> 1.电脑必须链接网络<br /> 2.登录root用户(可远程SSH登录)<br /> 3.执行安装命令:<br /> <br /> 1>安装Desctop组 <pre> <code class="language-bash">yum groupinstall "Desktop"</code></pre> <span style="color:#2ecc71">执行命令后会下载很多依赖包.我采用centos6.9的minimal版本需要安装283个依赖大约560MB,这里的执行时间和具体安装量可能和您的版本相关</span><br /> <br /> 2>安装X Window <pre> <code class="language-bash">yum groupinstall "X Window System"</code></pre> <span style="color:#2ecc71">下载数量94,大小11MB(因版本而异)</span><br /> 3>安装中文支持 <pre> <code class="language-bash">yum groupinstall "Chinese Support"</code></pre> <span style="color:#2ecc71">下载数量20,大小39MB(因版本而异)</span><br /> 4>启动 <pre> <code class="language-bash">startx</code></pre>