<script> jQuery.fn.setCursorPosition = function(position) { if(this.lengh == 0) return this; return $(this).setSelection(position, position); } jQuery.fn.setSelection = function(selectionStart, selectionEnd) { if(this.lengh == 0) return this; input = this[0]; if (input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', selectionEnd); range.moveStart('character', selectionStart); range.select(); } else if (input.setSelectionRange) { input.focus(); input.setSelectionRange(selectionStart, selectionEnd); } return this; } jQuery.fn.focusEnd = function(){ this.setCursorPosition(this.val().length); } jQuery("#listBoxWageItem").click(function (e) { if (jQuery.trim(jQuery(this).find("option:selected").text()) != "") { jQuery("#txtFormula").val(jQuery("#txtFormula").val() + "[" + jQuery.trim(jQuery(this).find("option:selected").text()) + "]").focusEnd(); } }); </script>
南来地,北往的,上班的,下岗的,走过路过不要错过!
======================个性签名=====================
之前认为Apple 的iOS 设计的要比 Android 稳定,我错了吗?
下载的许多客户端程序/游戏程序,经常会Crash,是程序写的不好(内存泄漏?刚启动也会吗?)还是iOS本身的不稳定!!!
如果在Android手机中可以简单联接到ddms,就可以查看系统log,很容易看到程序为什么出错,在iPhone中如何得知呢?试试Organizer吧,分析一下Device logs,也许有用.