davidcramer / baldrickjs Goto Github PK
View Code? Open in Web Editor NEWA Simple, Tiny Ajax Framework.
Home Page: baldrickjs.caldera.co.za
License: MIT License
A Simple, Tiny Ajax Framework.
Home Page: baldrickjs.caldera.co.za
License: MIT License
Follow a link that has a trigger which changes the pages content, then click back. If there is no longer a hash value in the address bar then the page will not go back to the state that the page was originally in before you clicked the link.
If we move the core emit() and on() functions from events plugin to Baldrickjs core we can use it to provide hooks into most parts of baldrick.
Should be able to move history, progress, clear, perhaps others to plugins.
hi,
this is so beautiful and well designed and documented Plugin, is there a way to integrate it with Angular.js
thanks in advanced.
Heyhey mr. cramer :) are there some instructions to use baldrick.js with a so called ajax load more?
The correct way to be doing history is not to have the hash.
in html5 you can use manipulate the history directly. This means you can change the whole URL without page reloads.
However this does mean your backend system needs to work with it.
example.
A trigger may request http://example.com/user/david
Using that URL directly should give you the exact same result as the end result.
So using this method, the server should be able to give ajax requests only the differences.
just a thought.
Need ideas on making the next update.
Hi,
I'm using baldrick.js and getting the error Cannot read property 'ownerDocument' of null
on the target function. It happens inside jQuery. It seems like the error is thrown because an ownerDocument property is missing. jQuery calls one of its functions and passes a.ownerDocument as an argument to it, and then inside the function it again checks for an ownerDocument property of that argument. But because it is null, essentially inside the function it tries to do null.ownerDocument, so it throws the error.
Do you have any idea why there is no ownerDocument property in the first place? Or what is causing this error?
We need a way to be able to create a new request programmatically.
Need a setting to set the placement of the request response in the target.
possible extras:
If two triggers have the same settings they will share the same ID for the hash.
An example is a pagination index above and below page. each page link would be duplicated in both.
I think it would be better to add a MutationObserver to the target element to watch for changes, and use DOMSubtreeModified event for older browsers.
It can then buildTriggers only within the change instead of reload the whole thing again.
Perhaps an attribute to make a trigger not produce a history. Thoughts?
Been thinking of having silent requests. It would be very useful to have a request happen without needing to output a result.
I think setting data-target="+void" could do this. Using the + or something to prevent using an element that just happens to have an ID "void".
Thoughts?
It would be nice to have something like
<button ... data-event="keyup:13" >
This would indicate that if keyup is 13 (enter) then fire event. Separating them with commas would give other keys..
<button ... data-event="keyup:13,27" >
Indicating that do request on enter or escape key.
On with data-event, It would be nice to be able to specify multiple events to bind to a trigger.
<input type="text" ... data-event="keyup,blur" />
This would then bind both keyup and loosing focus away from the element.
Further to this, if we added multi request options in the same way like:
<input type="text" ... data-request="user/update,user/check" data-event="keyup,blur" />
Could indicate that the first event binds to the first request and the second event to the second request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.