Comments (4)
Urlive does not come with user input handling in a <textarea>
or <input>
. But it has callback functions that you can use and execute your custom handling in a given instance.
This is the user input handling code in the <textarea>
demo page.
$('textarea').on('input propertychange', function () {
$('textarea').urlive({
callbacks: {
onStart: function () {
$('.loading').show();
$('.urlive-container').urlive('remove');
},
onSuccess: function (data) {
$('.loading').hide();
$('.urlive-container').urlive('remove');
},
noData: function () {
$('.loading').hide();
$('.urlive-container').urlive('remove');
}
}
});
}).trigger('input');
It's pretty straightforward. On the start of the AJAX request you can show your loading sign and remove the current url preview. And when the AJAX returns with success, the new url preview will be rendered and so you need to hide your loading sign. However when it returns with no data you need to remove the current url preview and hide loading sign. You can also make use of onFail()
callback just in case the AJAX request fails.
from urlive.
I found something. It's throwing the error before executing the callback function noData()
.
I will push an update.
from urlive.
It's now fixed please get the new update. Cheers!
from urlive.
oh~...thank you very much~!
from urlive.
Related Issues (20)
- Improve performance HOT 3
- Do not process mailto: links HOT 1
- images and relative path HOT 4
- urlive after ajax load content HOT 1
- For Most of the website I'm getting this error hence image could not be loaded HOT 2
- In reference to #11 issue HOT 1
- For video URL's from Youtube i get a script 1002 error in visual studio debugging. HOT 1
- return data.video enlaces youtube HOT 1
- Publish urlive in Bower HOT 3
- Canno embed video from youtube HOT 1
- Apparently this isn't working HOT 2
- retrieving special characters HOT 1
- marksenpai the urlive report
- V2 Update HOT 6
- demo not work HOT 1
- URLive doesn't work anymore HOT 3
- Is this project still active? HOT 1
- Demo is not Working.
- the js is dead
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 urlive.