Jump to content

Reloading a page without losing data


Palastia

Recommended Posts

Hey everyone. Is it possible to reload a page without losing data? The reason why I need this because in my scenario, I am inserting data (mathml) from a pop window into CKEditor text area and a plugin within CKEditor actually converts the mathml data into an image. But in order to do this, I need for the page to reload again after inserting the raw mathml to turn it into an image. So I need to be able to reload the page and keep the data within the CKEditor textarea. I have done quite a fair bit of research and stumbled upon the Ajax load function. But I am unsure if it can be used in my scenario. I would appreciate if someone could provide me with some advice and point me in the right direction. Thanks.

Link to comment
Share on other sites

You don't need to reload the page, you just need to fire CKEditor's update functions. The ones that normally gets fired when you write normally in the field.

You might even succeed with firing the insitric event itself from within your script, so you might want to try that first.

Link to comment
Share on other sites

Hey christian thanks for replying! Based on what I've read on CKEditor's API documentation, the only instance that I can use for this is UpdateElement();? I tried this once but it did not work. I suspect probably Im not sure where to use it and didn't write the code correctly.

Link to comment
Share on other sites

I apologize for my ignorance, but what exactly is the "keyup" insitric event (on the editor element)? Please forgive me, Im rather new to coding altogether.

 

Edit: So I just looked up the keyup event but how exactly can I use this to preserve the data upon reloading the text area?

Link to comment
Share on other sites

I see. But I think the CKEditor text area needs to sort of reload. I tested location.reload upon inserting mathml into CKEditor from a popup window and it worked (the mathml becomes an image from a plugin within CKEditor), but only in FireFox, since it supports forward-back caching and no javascript states are actually lost. Other browsers just reloaded the page entirely without the mathml data in textarea. Where should I use the onkeyup event to make it work? Thanks.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.