Comments (15)
And the indicator chapter, how you add the aira-busy class to target table, that is not clear enough. Would you please share?
from alpine-ajax.
Hi!
Do you think you would have x-ref available to replace x-target
Thatβs not likely to happen because we need a unique identifier on the page so that we know what content to merge inside an incoming request. x-ref
is only unique per component, but id
is required to be unique per page.
how you add the aira-busy class to target table
aria-busy
is automatically added to a target when it is updating. You only need to write the CSS to make an indicator show when aria-busy
is present.
from alpine-ajax.
That means aria-busy this css just prepared there, then indicator would take it if indicator tag is used, that is what you meant?
from alpine-ajax.
Then x-target can accept dynamic id? I mean the target id can be generated after it is being loaded into webpage.
from alpine-ajax.
That means aria-busy this css just prepared there, then indicator would take it if indicator tag is used, that is what you meant?
Yes, I think that's about right. There's not an indicator "tag" but you create the indicator by checking if aria-busy
is present on a target using a CSS selector. I made a some quick demos that might help explain it better: https://codepen.io/imacrayon/pen/JjzGeMa
from alpine-ajax.
Then x-target can accept dynamic id? I mean the target id can be generated after it is being loaded into webpage.
hi @imacrayon,
I have this concern, thanks. Please help me verify it.
from alpine-ajax.
Yes the ID in x-target
can be dynamic you can include more than one ID too.
from alpine-ajax.
That is great, thanks for your help.
from alpine-ajax.
I saw all the examples, the whole alpine-ajax must be used within a form element? That is a must?
from alpine-ajax.
Can you give me more $ajax example, I try to understand it better, and think about how to use it properly.
from alpine-ajax.
Sorry, @imacrayon
I have one more question, how to add request header through $ajax to server, not the X-Alpine-Request I am talking about.
Thanks
Eric Xin
from alpine-ajax.
No way to customize headers yet. That will probably be coming soon though.
from alpine-ajax.
Ok, then how about $ajax, we can use it in any element right?
from alpine-ajax.
Yeah, just like any other Alpine magic, you can use it within any event handler on any element.
from alpine-ajax.
That is excellent, good news to know.
from alpine-ajax.
Related Issues (20)
- Calling $ajax from code outside of Alpine.js HOT 5
- Use ajax:success to preload assets (js) HOT 3
- Could not find a declaration file for module '@imacrayon/alpine-ajax' HOT 3
- Any way to make incoming html replace the innerHTML of target instead of the whole target? HOT 3
- Uncaught (in promise) Missing Target: #[object HTMLButtonElement] was not found in the current document. HOT 5
- SSE and websockets support HOT 4
- Using x-morph, new Alpine components don't initialize HOT 5
- Apply different merge strategy per target HOT 4
- Polling support? HOT 2
- Dynamically assigning a value for x-target not working, but works if assigning it statically. HOT 4
- Filterable content + infinite scroll: how to set x-merge attribute HOT 3
- v.0.6.0 broke the usual x-target behavior HOT 8
- x-target response code modifiers HOT 2
- Question: Fetch and headers HOT 2
- Global event listeners HOT 4
- x-sync deletes div if no matching id in response HOT 1
- Redirect on successful form submission HOT 8
- Website examples are currently not working HOT 2
- Does x-target require a form? HOT 2
- x-target response modifiers & aria-busy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alpine-ajax.