Comments (10)
I belive you might need to initialize it in the first place, using
new JQuery("button").button()
...before .buttonLoading()
You should try to debug this through Chrome Developer Tools or Firebug console, trying to see if just typing $("button").button('loading')
works.
BTW do you receive any error in the console ?
from haxe-bootstrap.
I updated my initialize function to:
new JQuery(".btn").button();
myButton = new JQuery(".btn").button('loading');
and Firebug showed me this error: TypeError: $ is undefined in var old = $.fn.button
This happens here in my js file:
/* BUTTON PLUGIN DEFINITION
* ======================== */
var old = $.fn.button
from haxe-bootstrap.
You need to include JQuery, dude...
On Wed, May 29, 2013 at 10:53 AM, Jean-Baptiste Richardet <
[email protected]> wrote:
I updated my initialize function to:
new JQuery(".btn").button();
myButton = new JQuery(".btn").button('loading');and Firebug showed me this error: TypeError: $ is undefined in var old =
$.fn.buttonThis happens here in my js file:
/* BUTTON PLUGIN DEFINITION* ======================== */var old = $.fn.button
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-18603631
.
from haxe-bootstrap.
In the JS file ? Doesn't import js.JQuery;
in the Haxe file do the trick ?
from haxe-bootstrap.
I think the most reliable way is just to include jquery manually
(eventually from Google CDN) using a <script> tag.
I don't know the current status of Haxe's js.JQuery regarding this, but I
believe it has changed in Haxe3 (no injection by default)
On Wed, May 29, 2013 at 11:06 AM, Jean-Baptiste Richardet <
[email protected]> wrote:
In the JS file ? Doesn't import js.JQuery; in the Haxe file do the trick ?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-18604212
.
from haxe-bootstrap.
I added
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
before my own script tag but the error's still here.
Thanks for your help, I'm kind of a noob with JS.
from haxe-bootstrap.
I believe bootstrap is not compatible with JQuery 2.x series (
twbs/bootstrap#7627)
You'll need to include 1.9.1 or something
On Wed, May 29, 2013 at 11:24 AM, Jean-Baptiste Richardet <
[email protected]> wrote:
I added
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script><script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>before my own script tag but the error's still here.
Thanks for your help, I'm kind of a noob with JS.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-18604993
.
from haxe-bootstrap.
BTW you don't need JQuery UI I think
from haxe-bootstrap.
One stupid error between the chair and the keyboard: Google CDN link doesn't have http:
. Once I added it, it worked.
Here's my starter code for future beginners:
package;
import js.Lib;
import js.JQuery;
import js.Browser;
using js.bootstrap.Button;
class TestBootStrap {
private var myButton:JQuery;
public function new(){
initialize();
}
private function initialize(){
new JQuery("button").button();
myButton = new JQuery("button");
myButton.click(function(e){
Lib.alert("ok");
myButton.button('complete');
});
}
static function main(){
new JQuery (Browser.document.head).ready(function(evt){
new TestBootStrap ();
});
}
}
With this HTML button
<button type="button" class="btn" data-complete-text="finished!">...</button>
from haxe-bootstrap.
It's really weird because "//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js" should work.
Omitting "http:" is actually valid, it's intended to make the same link work both in http and https...
Well, it seems to work anyway, so nevermind ;)
from haxe-bootstrap.
Related Issues (2)
- Haxe3 migration 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 haxe-bootstrap.