- $(document).ready(function() {
- $('#f_title').focus();
- $('#form_thread').ajaxForm({
- dataType: 'json',
- success: function(json) {
- if(json.msg){
- $('#error_msg').hide();
- $('#error_msg').html(json.msg);
- $('#error_msg').show("fast");
- }
- else if(json.id){
- location.href = "$link.root("bbs/thread/")" + json.id;
- }
- }
- });
- $('#form_thread').bind('form-pre-serialize', function(event,form,options,veto){
- tinyMCE.triggerSave();
- });
- $("#form_thread").ajaxStart(function(){
- if(tinyMCE && tinyMCE.get('f_content'))
- tinyMCE.get('f_content').setProgressState(1); // Show progress
- });
- $("#form_thread").ajaxComplete(function(event,request, settings){
- if(tinyMCE && tinyMCE.get('f_content'))
- tinyMCE.get('f_content').setProgressState(0); // Show progress
- });
- });
- //该片段来自于http://www.codesnippet.cn/detail/050120131309.html
来源: http://www.codesnippet.cn/detail/050120131309.html