Forgot password
 Register account
View 260|Reply 0

[JS]编辑帖子提交后保留在编辑页面

[Copy link]

3156

Threads

7932

Posts

45

Reputation

Show all posts

hbghlyj posted 2022-2-19 01:43 |Read mode
Last edited by hbghlyj 2022-2-19 02:10有时编辑帖子要来来回回改好多次,改的时候还得找上一次编辑的位置,如果不刷新的话就可以在上次的位置继续往下写了,比较节省时间,有没有方法办到呢?
如果用onbeforeunload事件的返回值弹出确认窗口阻止页面刷新的话,比如onbeforeunload=()=>1,会导致表格根本不会被提交


好像弄成功了:
  1. newwin=open();newwin.document.write(document.forms[0].outerHTML);newwin.document.forms[0].message.value=$("e_textarea").value;newwin.document.forms[0].submit()
Copy the Code
但是"发帖选项"无法设置上.
不过这应该没有关系...因为多次修改的时候都是修改帖子内容...发帖选项在第1次就确定了,不会更改.


我试了一下,如果把"Html代码"勾上然后用上述方法提交表格则仍是"Html代码"模式,而不会被重置到默认设置.那我就放心了

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-6-8 15:43 GMT+8

Powered by Discuz!

Processed in 0.015970 second(s), 22 queries

× Quick Reply To Top Edit