Skip to content
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

Three questions about ajaxify #24

Open
bildlich opened this issue Oct 8, 2013 · 1 comment
Open

Three questions about ajaxify #24

bildlich opened this issue Oct 8, 2013 · 1 comment

Comments

@bildlich
Copy link

bildlich commented Oct 8, 2013

I hope this is the right place to ask these questions.

  • How does ajaxify determine which DOM elements are the content and menu containers? I haven't seen a way to pass a selector.
  • Are ajax requests cached so that a repeated request for the same link is executed faster?
  • The last questions is more related to History.js: In ist readme I've only found examples with URLs like www.mysite.com/?state=1. Can it handle pretty URLs like www.mysite.com/state/1 as well?
@randomobject
Copy link

This may be an old post but for folks stumbling across it. I can answer the first question. If you take a look at the ajaxify.js you see / find the following:

/* Application Specific Variables */
contentSelector = '#container',
$content = $(contentSelector).filter(':first'),
contentNode = $content.get(0),
$menu = $('#menu,#nav,nav:first,.nav:first').filter(':first'),
activeClass = 'current-menu-item',
activeSelector = '.current-menu-item',
menuChildrenSelector = '> li,> ul > li',
completedEventName = 'statechangecomplete',
/* Application Generic Variables */
$window = $(window),
$body = $(document.body),
rootUrl = History.getRootUrl(),
scrollOptions = {
duration: 0,
easing:'swing'
};

Menu container is this line:

$menu = $('#menu,#nav,nav:first,.nav:first').filter(':first'),

and content container is this line;

contentSelector = '#container',

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants