Categoryjavascript

Javascript in the window.name

Wow. What a nice idea.

http://code.google.com/p/quipt/

Note: if you want to make the test.html to work checkout and test on http://… it is some beta but it works great only in Firefox

Opera beautifully engineered…for my desktop

I was nice surprised when I tried Opera browser for PC after aprx. one year Firefox usage.

Zooming is faster and smarter than in every browser that I have used.

Firefox boot like MS Windows, and is almost stable like it.

Opera is faaaaast. Gmail is fast. And my work is going fast because all webpages are opening fast.

What? Why you need faster browser if it doesnt support right CSS, DOM, or what ever?

Who said this ? Check the tests for CSS2 and see that Opera and FF are failing apx on the same tests on the same places I am not sure even who is the winner. Check also this those acid tests also

Does someone has tried the dragonfly plugin – analog for the firefox firebug ?

I must agree that the Opera release 9.50 (Build 10063) has some strange javascript support. It happends that when I paste an URL for RSS in Opera, the current page disapears, maybe this is a feature and not a bug :)

Also I am very very disapointed that I should write this article in FF because the build-in WordPress editordoesnt work for Opera :)

Copy checkboxes from one form to another with Prototype

I have a case where the user must select items from a basket and use them with different forms.

Example:
Some items in this form
  • Item:
  • Item:
  • Item:
  • Item:
Another form here
(I will create here hidden fields from the the checkboxes in the first box)

I will show you how to use the checked boxes from the first form with the submit action in the second form

It would be easy if the form could be one – less support.

I am starting with those two forms

  • Helper form – Form with checkboxes
  • Action form – the form that will do the real action based on the selected items in the helper form

Here is how it looks the helper form. All the checkboxes are tagged with the class=”selectable”. Here is rails example but you can implement it pure html.

<%= check_box_tag('selected[]', true, image.selected?, :class=>"selectable") %>

Then we can select all the checkboxes with this javascript.

var make_to_hidden = $$('input.selectable');

Put on your action form an id so we can access it easy in this case:

<form id="mail_form" onsubmit="import_selected_basket()"> ... </form>

Lets add those checkboxes from the first form to the real action form with this javascript function

      function import_selected_basket() {
          var make_to_hidden = $$('input.selectable');
          make_to_hidden.each(function(item) {
              if (item.checked) {
                var new_item = new Element('input', { 'type': 'hidden', name: item.name, value: item.value })
                $('mail_form').appendChild(new_item)
              }
          });

Javascripts

Good prototype controls

http://livepipe.net/#hoverbox

Directly print pdf files from a browser

function Printobject(){
document.all.PDF.print();
setTimeout(“self.close();”,4000); }

© 2024 Gudasoft

Theme by Anders NorénUp ↑