Note that there are some explanatory texts on larger screens.

plurals
  1. PORatchet's push.js form submit reloads page, messes up push.js replacing div
    primarykey
    data
    text
    <p>I am developing a web application with ratchet.js (and their push.js) and have a very basic problem. My CSS code positions elements in one page in three columns. The user then can click on a navigation bar button to goto the next page. Once in the next page, the user can search for something. For the search, I handle it via a form and use jquery to detect when a form is submitted. However, when the form is submitted, the page is reloaded and push.js malfunctions. When this happens and the user clicks to go back to the first page, my css does not function properly as it is still surrounded by the second page's content div. My question: is there a way to submit a form without reloading a page (jquery's event.preventDefault() does not work)? If not, can push.js be used and then have the page reload itself once the transition is completed?</p> <p>Basic Code Examples: Page 1 ----</p> <pre><code> &lt;body&gt; &lt;div class="content"&gt; &lt;div class="sliderBackground" id="sliderContainer" style="background: black; height: 40px; width: 100%;"&gt; &lt;div id="left"&gt;random left&lt;/div&gt; &lt;div id="center"&gt;random center&lt;/div&gt; &lt;div id="right"&gt;random Right&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>Page 2</p> <pre><code> &lt;body&gt; &lt;div class="content"&gt; &lt;form id="search"&gt; &lt;input type="search" id="searcher" placeholder="Search" style="width: 95%;"&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; necessary imports (jquery etc) &lt;script type="text/javascript"&gt; $("#search").submit(function(event) { event.preventDefault(); // does not do anything (push.js... reloads page) }); &lt;/script&gt; </code></pre> <p>to reiterate my problem, the user clicks on a link (not shown in basic code) to use push.js to goto page 2. in page 2, they sure, where the page reloads when it should not (I am using ajax to utilize the search query etc). When the user goes back, the left, center, right css no longe works.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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