[jQuery] What am i doing wrong????

2009-07-31 Thread PictureMan

When I add this rule to a page with the other rules, my page stops
validating.
Works fine if I don't add it.

What this is for is a check box next to a input box.  IF the check box
is checked, the field is mandatory.

OtherCruiseLine: {
required: function(element) {
return $("input[name='CruiseLinesPicked'][value='Other']").is
(':checked');
}

without this rule the page validates.  With this I get an error of:
missing } after property list.

But not sure what's wrong..


Thanks!




[jQuery] What am I doing wrong here -- htmlTo?

2008-12-16 Thread ken
I am trying to do the following:

1) create an IMG
2) assign an SRC to the IMG
3) wrap the IMG in 's
4) insert the resultant HTML into #foo

I have been hammering at this for awhile now, and am having problems; I've
tried using wrap and some of the other content-manipulation methods, but I
still can't get the implementation down to something short and sweet
(referencing jQuery only once). This is the best I've got so far:

var html = jQuery( '' )
.find( 'img' ).attr( 'src', 'image.gif' ).end();

jQuery( '#foo' ).html( html );

I realize that I could use the literal expression in place of the "html"
variable, but that's no better IMO.

What I originally started out doing, was something like this:

jQuery( '' ).attr( 'src', 'image.gif' ).wrap( ''
).replaceAll( '#foo' );

But, replaceAll removes the node (I only want to change its contents).

What I've noticed, is that the jQuery API provides alternative forms of 3
methods (that I don't see used very often): append, prepend, and replace.
These 3 support both of the followng forms, and I believe they are 100%
interchangeable:

jQuery( selector ).method( html );
jQuery( html ).methodTo( selector );

However, .html(), which is arguably more popular, only has the 1st form, but
not the second. Is there an alternative form for html() that I'm missing, or
is this a hole in the API that apparently isn't wanted?

Thanks in advance!


[jQuery] What am I doing wrong?

2008-09-17 Thread conspirator

I can't seem to get this to work for a client. I'm not a genious at
jQuery, but I think this is supposed to work. What am I doing wrong?









Shadowbox.loadSkin('classic', 'some/path/to/js/shadowbox/src/skin');
Shadowbox.loadLanguage('en', 'some/path/to/js/shadowbox/src/lang');
Shadowbox.loadPlayer(['flv', 'html', 'iframe', 'img', 'qt', 'swf',
'wmp'], 'some/path/to/js/shadowbox/src/player');

$(document).ready(function(){
  Shadowbox.init();
});



http://www.someotherpage.com/other/page";>jQuery