Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI without HTML

Is there a project (open source) that takes the widgets and plugins for jQuery UI but allows us to use them without setting up any HTML?

Kinda like Ext-js and Sproutcore, but without the acidental complexity and lack of fluidity, and more like Cappuccino, but without requiring a Mac and the horrible load times from Objective-j (which also has no IDE support). Also, more like Ukijs, but with more widgets. And kinda like Pyjamas and GWT, but without the lack of widgets, pre-compiling step, and/or Java. For example:

uki({
  view: "Button", text: "Hello world!",
  rect: "120 80 180 24",
  click: function() { alert(this.text());
}).attachTo( document.getElementById("test") );

The reason I'm taking jQuery is because it is the only web framework that supports all 30 essential controls (given with enough plugins).

like image 800
Daniel Ribeiro Avatar asked Jul 24 '10 00:07

Daniel Ribeiro


People also ask

Can I use jQuery UI without jQuery?

If you want to use jQuery. UI you have to include jQuery.

Is jQuery UI still supported?

Support for jQuery 1.7 has been dropped; jQuery 1.8 & newer remain supported. In this release, all individual module files as well as bundled jQuery UI copies produced by the Download Builder have all its code running in strict mode.

Is jQuery UI a library?

jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.


1 Answers

Let's see if I understand the question. Instead of

<script>
  $(function(){
    $('a').button();
  });
</script>
<body>
  <button id="foo">Foo</button>
  <button id="bar">Bar</button>
</body>

You want

<script>
  $(function(){
    $('body').append($('<button>').attr('{ id: "foo" }').html('Foo').button());
    $('body').append($('<button id="bar">Bar</button>').button());
  });
</script>
<body>
</body>

Does that meet your needs? At the end of the day you'll still need to specify the details of the button (where it goes, its text, what happens when you click it) no matter what the syntax is.

like image 64
Mr. Shiny and New 安宇 Avatar answered Nov 15 '22 16:11

Mr. Shiny and New 安宇