Note that there are some explanatory texts on larger screens.

plurals
  1. POCKEditor and jQuery serialize() issue
    primarykey
    data
    text
    <p>I'm having trouble with the jQuery serialize() function.</p> <p>In context, I'm opening a form and checking for changes made to it, so when the form loads, I serialze the data and assign it to a global variable:</p> <pre><code>form_data.edit_initial = $('#edit-job-form').serialize(); </code></pre> <p>That works fine.</p> <p>Then when I come to click a button to leave the form, it performs this check:</p> <pre><code>var start = form_data.edit_initial; var end = $('#edit-job-form').serialize(); if (start == end) { // Do button action } else { // Open confirm dialogue } </code></pre> <p>ANYWAY. Both serialize() functions work, but the second one has converted apostrophes etc into a series of numbers and percentage symbols (Which i can safely assume is some code for apostrophe).</p> <p>Any ideas why? It means even when no changes are made, the dialogue opens and moans that the form's been changed without saving.</p> <p><strong>Help!</strong></p> <p>Here's some sample data.</p> <p>I am using a CKEditor instance.</p> <p>Part of the first result:</p> <pre><code>&amp;edit_time_digital=60&amp;edit_desc=%3Cp%3E%0D%0A%09They'd+like+the+share+their+site+incase+people+want+to+see+their+entire+collection+of+furnature.%3C%2Fp%3E%0D%0A%3Cp%3E%0D%0A%09The+site+needs+the+following%3A%3C%2Fp%3E%0D%0A%3Cul%3E%0D%0A%09%3Cli%3E%0D%0A%09%09Home+page%3C%2Fli%3E%0D%0A%09%3Cli%3E%0D%0A%09%09Standard+pages%3C%2Fli%3E%0D%0A%09%3Cli%3E%0D%0A%09%09Galleries+(By+category)%3C%2Fli%3E%0D%0A%09%3Cli%3E%0D%0A%09%09Contact+page%3C%2Fli%3E%0D%0A%09%3Cli%3E%0D%0A%09%09News+listings%3C%2Fli%3E%0D%0A%3C%2Ful%3E%0D%0A%3Cp%3E%0D%0A%09It+should+be+a+very+simple+generator+build.%3C%2Fp%3E%0D%0A&amp;edit_status=active` </code></pre> <p>and the second:</p> <pre><code>&amp;edit_time_digital=60&amp;edit_desc=%3Cp%3E%0D%0A%09They%26%2339%3Bd+like+the+share+their+site+incase+people+want+to+see+their+entire+collection+of+furnature.%3C%2Fp%3E%0D%0A%3Cp%3E%0D%0A%09The+site+needs+the+following%3A%3C%2Fp%3E%0D%0A%3Cul%3E%0D%0A%09%3Cli%3E%0D%0A%09%09Home+page%3C%2Fli%3E%0D%0A%09%3Cli%3E%0D%0A%09%09Standard+pages%3C%2Fli%3E%0D%0A%09%3Cli%3E%0D%0A%09%09Galleries+(By+category)%3C%2Fli%3E%0D%0A%09%3Cli%3E%0D%0A%09%09Contact+page%3C%2Fli%3E%0D%0A%09%3Cli%3E%0D%0A%09%09News+listings%3C%2Fli%3E%0D%0A%3C%2Ful%3E%0D%0A%3Cp%3E%0D%0A%09It+should+be+a+very+simple+generator+build.%3C%2Fp%3E%0D%0A&amp;edit_status=active </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload