Skip to content

Conversation

@darksmo
Copy link

@darksmo darksmo commented Jul 7, 2013

Hello, I've been using djax for a project and made a bunch of changes.

See commit messages for details.

I was wondering if you would like to pull and merge the changes in the main repository.

Changes are basically:

  • ajaxLoaded is an additional event triggered when all the items have been replaced
  • added one more rule for replacing blocks of markup (see 58f03a0)
  • all click events are namespaced
  • cross-browser title replacement (wasn't working on IE7)
  • public navigate method to trigger navigation programmatically
  • more standard jquery plugin interface (see 53871aa)

Cheers,
Savio

darksmo added 10 commits July 2, 2013 10:37
1) in case no previous sibling of a certain *new* block is
   found, djax used to prepend this block within its parent,
   and this behaviour is preserved.

2) however, in case a new block has no parent (or no id is
   specified for the parent enclosing a certain set of
   blocks) the new block is inserted after the previous
   block.

The case 2) is triggered with a response like:

  <div>
    <div id="...">...</div>
    <div id="...">...</div>
    <div id="...">...</div>
  </div>

  (note that the enclosing block has no id).
- public method to trigger a djax update programmatically
- make code more standard as explained in http://learn.jquery.com/plugins/basic-plugin-creation/
@beezee
Copy link
Owner

beezee commented Jul 7, 2013

@darksmo all sounds great and thanks for opening- this will take me some time to evaluate since the diff is so large.

One note from initial readthrough- the syntax is incorrect in your updated readme examples (missing curly brackets around parameter object)

Other than that I'll aim to give a line by line readthrough within the next week and I'll add any comments to specific commits as necessary, or merge if everything looks good.

Thanks again for all this, very cool pull request.

@darksmo
Copy link
Author

darksmo commented Jul 7, 2013

Cool, have fixed the syntax in the documentation...

@WTVader
Copy link

WTVader commented Jun 24, 2014

Recently I came across your fork of djax and tried it on a project. I was wondering if the script is working properly since I got multiple errors due to e.g. the following code:

$('a:not(.' + settings.ignoreClass + ')',…

But even by changing the code to get rid of the errors the script doesn’t insert anything from the ajax call. Maybe you can help me to get the script working as desired.

@darksmo
Copy link
Author

darksmo commented Jun 24, 2014

Hello @WTVader, please ignore that fork.

After this commit it really diverges from the original project (DJAX). I should perhaps delete it or point it in the README to avoid further confusion around.

The one I'm currently using is DDJAX (see https://github.com/lokku/jquery-ddjax). It shares the same idea as DJAX, but the implementation of block replacements is left to you (e.g., for better performance).

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

Successfully merging this pull request may close these issues.

3 participants