Comments (3)
I don't see right off where in the code it should act this way, so it may be a bug.
However if you need dynamic html a better approach to do this would be to pass a function that returns a string to the html option:
$.prompt([{
title: "Add Media",
buttons: { "Close":false },
html: function(){
return 'my computed html';
},
loaded: function(){
$(window).resize();
}
}]);
This would be less like a "hack" and the function will get computed every time the state is shown.
from jquery-impromptu.
Oh maybe you dont even need to pass the string then?
from jquery-impromptu.
Correct, but notice the array brackets around the options object. It basically creates a state. There is actually an issue with the above example. I passed the loaded callback to the state, it should be to the options:
$.prompt(
[
{
title: "Add Media",
buttons: { "Close":false },
html: function(){
return 'my computed html';
}
}
],
{
loaded: function(){
$(window).resize();
}
}
);
from jquery-impromptu.
Related Issues (20)
- 'show' option is not working HOT 3
- Can't get Enter keypress to click "OK" HOT 1
- Buttons with HTML characters not created correctly HOT 3
- Can't trigger the event of a non-default button in a modal when the Enter key is pressed
- Close Event
- Callback function HOT 1
- Form submission causes submission of all states
- html option text? HOT 1
- Prompts not always showing in IE11/ME, Graphical Bug HOT 2
- Webjar License Error HOT 3
- Pattern validation
- Responsive? HOT 2
- multi language text or images instead of buttons in impromptu HOT 1
- Getting tooltip dimensions in "position" function
- I need that close bottom, close the div and erase the data not submit.
- $.prompt is not a function HOT 2
- custom buttons
- Awesome plugin HOT 1
- Jquery Mobile Compatibility? 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 jquery-impromptu.