-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pjax form submit heroku example #489
base: heroku
Are you sure you want to change the base?
Changes from 2 commits
7b152cf
a0d7c26
301927f
90b8cdd
517ae3d
57fbf58
aaeebce
c28167a
3ec6dad
d65d5f1
5e98eb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,21 @@ | |
<%# finally, make the page-top bar somewhat respectably toned down too %> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
|
||
<script src="jquery.js"></script> | ||
<script src="jquery.cookie.js"></script> | ||
<script src="pages.js"></script> | ||
<!-- <script src="jquery.js"></script> --> | ||
<script src="//code.jquery.com/jquery-1.11.2.js"></script> | ||
<!-- <script src="jquery.cookie.js"></script> --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 for removing old cookie plugin especially if it doesn't work anymore. |
||
<!-- <script src="pages.js"></script> --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file was pretty important because it kept the state of the checkbox consistent between page refreshes. I get that it was broken because the cookie plugin was broken. Instead of setting cookies, you can try using |
||
|
||
<script src="jquery.pjax.js"></script> | ||
<script type="text/javascript"> | ||
$(function(){ | ||
// pjax | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change the invocation? I preferred the shorter form. It works good as a demo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's legacy API. With the version of jquery I updated, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah OK, got it. The new invocation you wrote looks good. |
||
$('ul a').pjax('#main') | ||
// $('ul a').pjax('#main') | ||
$(document).pjax('ul a', '#main'); | ||
// $(document).pjax('form', '#main'); | ||
$(document).on('submit', 'form', function(e) { | ||
$.pjax.submit(e, '#main'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 for form submit pjax, but we don't use semicolons in pjax code itself, so we don't need to use them in demo code as well. |
||
}); | ||
}) | ||
</script> | ||
|
||
|
@@ -51,7 +57,7 @@ | |
## a a . | ||
( '._) | ||
|'-- | | ||
_.\___/_ ___<label><input type="checkbox" name="pjax" />pjax</label>___ | ||
_.\___/_ ___<label><input type="checkbox" name="pjax" checked />pjax</label>___ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 for making the |
||
."\> \Y/|<'. '._.-' | ||
/ \ \_\/ / '-' / | ||
| --'\_/|/ | _/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 from loading from CDN. You may remove the old vendored
jquery.js
and references to it.