[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread wick

Rick, as far as I can tell there is something wrong with two of the
code examples you provided.

var mySet = '$(mySet)';   ...this sets the mySet variable to a string
that *looks* like a jQuery selector, but your quotes make it into a
useless string.
$('mySet').find(':text')......this selector looks for a mySet
HTML object (which does not exist), again, because of the way you have
the quotes. It doesn't use the mySet variable reference at all.

To answer GGerri's question..

var mySet = $('trtd:nth-child(2n)');  ...assigns a jQuery object to
the mySet variable.
mySet.find(':text')   ...takes your jQuery object  applies find() to
it.
$(mySet).find(':text')   ...takes your jQuery object, runs it through
the jQuery selector engine again,  applies find().

Both ways work okay, but the 2nd way isn't the best because running a
jQuery object through the selector engine again serves no purpose that
I'm aware of. Normally you'd use the 2nd example only if mySet was a
DOM object reference, not a jQuery object reference.

Regarding GGerri's question about the this variable - in jQuery,
this refers to a DOM object so you always need to wrap it with the
jQuery $(...) selector if you're going to use jQuery methods on it.

A useful variable naming convention I've seen is to prefix any jQuery
object variables with a dollar sign. It's an easy reminder that the
variable is already a jQuery object. In other words:

var $mySet = $('div h1 a');  $mySet becomes a jQuery object
$mySet.show(300,function() {
  $(this).fadeIn(); ...this is a DOM object, so you need to wrap it
with the jQuery selector
});

Hope that helps!

-Wick
http://www.CarComplaints.com


On Mar 5, 7:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
 Hi, Rayn :handshake: :o)

 I think, for shorthand notation (some say for readability, but I think 
 otherwise),
 some set var's (variables) to represent pieces of code, for instance:

 var mySet = '$(mySet)'

 and then use it as:

 mySet.find(':text')...

 Written in longhand, it would be:

 $('mySet').find(':text')...

 When trying to read someone else's code, where this shorthand is use 
 extensively,
 I just find it hard to decipher, since I have to trace all the var's down to 
 find
 out what they stand for...

 Someone please correct me if I'm wrong...

 Rick

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
 Behalf Of ggerri
 Sent: Thursday, March 05, 2009 7:31 AM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and 
 $(varXy).find(':text')

 Thanks Ryan :handshake:

 so  mySet.find(':text').each(...) would be right and
 $(mySet).find(':text').each(...) not? :confused:

 In examples I often see (within an each function): $(this).something but also 
 this.something

 Still dont get the difference of use :,(

 G

 ryan.joyce...@googlemail.com wrote:

  mySet is an object or variable, $(mySet) will try to get an element
  using the contents of mySet as the selector.

  On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
  Hi there

  thats an easy one for you ;-)

  if i do:

  var mySet = $('trtd:nth-child(2n)');

  how do I use mySet? What's the difference between

  mySet.find(':text')

  and

  $(mySet).find(':text')

  Thanks :-))
  GGerri

  --
  View this message in
  context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.

 --
 View this message in 
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread wick


Cool. By the way, regarding your question about determining the
javascript processing time, something like this is helpful:

http://jdev.blogsome.com/2006/08/18/compact-script-to-calculate-script-execution-time/


On Mar 5, 12:02 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 Oh, you're absolutely right, wick... I was just careless in my coding.
 Thanks for pointing that out and correcting the example...for my sake
 and, especially for GGerri's!

 Rick

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

 Behalf Of wick
 Sent: Thursday, March 05, 2009 11:58 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and
 $(varXy).find(':text')

 Rick, as far as I can tell there is something wrong with two of the code
 examples you provided.

 var mySet = '$(mySet)';   ...this sets the mySet variable to a string
 that *looks* like a jQuery selector, but your quotes make it into a useless
 string.
 $('mySet').find(':text')...    ...this selector looks for a mySet
 HTML object (which does not exist), again, because of the way you have the
 quotes. It doesn't use the mySet variable reference at all.

 To answer GGerri's question..

 var mySet = $('trtd:nth-child(2n)');  ...assigns a jQuery object to the
 mySet variable.
 mySet.find(':text')   ...takes your jQuery object  applies find() to
 it.
 $(mySet).find(':text')   ...takes your jQuery object, runs it through
 the jQuery selector engine again,  applies find().

 Both ways work okay, but the 2nd way isn't the best because running a jQuery
 object through the selector engine again serves no purpose that I'm aware
 of. Normally you'd use the 2nd example only if mySet was a DOM object
 reference, not a jQuery object reference.

 Regarding GGerri's question about the this variable - in jQuery, this
 refers to a DOM object so you always need to wrap it with the jQuery $(...)
 selector if you're going to use jQuery methods on it.

 A useful variable naming convention I've seen is to prefix any jQuery object
 variables with a dollar sign. It's an easy reminder that the variable is
 already a jQuery object. In other words:

 var $mySet = $('div h1 a');  $mySet becomes a jQuery object
 $mySet.show(300,function() {
   $(this).fadeIn(); ...this is a DOM object, so you need to wrap it with
 the jQuery selector });

 Hope that helps!

 -Wickhttp://www.CarComplaints.com

 On Mar 5, 7:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
  Hi, Rayn :handshake: :o)

  I think, for shorthand notation (some say for readability, but I think
  otherwise), some set var's (variables) to represent pieces of code, for
 instance:

  var mySet = '$(mySet)'

  and then use it as:

  mySet.find(':text')...

  Written in longhand, it would be:

  $('mySet').find(':text')...

  When trying to read someone else's code, where this shorthand is use
  extensively, I just find it hard to decipher, since I have to trace
  all the var's down to find out what they stand for...

  Someone please correct me if I'm wrong...

  Rick

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com]
  On Behalf Of ggerri
  Sent: Thursday, March 05, 2009 7:31 AM
  To: jquery-en@googlegroups.com
  Subject: [jQuery] Re: Simple one: difference between
  varXy.find(':text') and $(varXy).find(':text')

  Thanks Ryan :handshake:

  so  mySet.find(':text').each(...) would be right and
  $(mySet).find(':text').each(...) not? :confused:

  In examples I often see (within an each function): $(this).something
  but also this.something

  Still dont get the difference of use :,(

  G

  ryan.joyce...@googlemail.com wrote:

   mySet is an object or variable, $(mySet) will try to get an element
   using the contents of mySet as the selector.

   On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
   Hi there

   thats an easy one for you ;-)

   if i do:

   var mySet = $('trtd:nth-child(2n)');

   how do I use mySet? What's the difference between

   mySet.find(':text')

   and

   $(mySet).find(':text')

   Thanks :-))
   GGerri

   --
   View this message in

 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
 %...
   Sent from the jQuery General Discussion mailing list archive at
   Nabble.com.

  --
  View this message in
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
 %...
  Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.


[jQuery] Re: $.browser and jQuery 1.3

2009-02-06 Thread wick

Just adding my $0.02 about why browser sniffing should be discouraged
but never completely deprecated -

I use browser sniffing to redefine the fadeIn/fadeOut effects to
slideDown/slideUp for IE7, because of the ClearType issue. It's a case
where the effect _works_, so I can't use feature detection, but since
the opacity animation effects look awful, it's not realistic to use
those effects in IE7. As far as I can tell, it's a case where browser
sniffing is still the best option.

  if ($.browser.msie) {
jQuery.fn.fadeOut = jQuery.fn.slideUp;
jQuery.fn.fadeIn = jQuery.fn.slideDown;
  }

(I know I *should* be testing for IE version ... but then again it
wouldn't surprise me at all if the ClearType problem persists in IE8)

-Wick
http://www.CarComplaints.com


On Feb 5, 5:45 am, Liam Potter radioactiv...@gmail.com wrote:
 I'm doing this because every now and then safari seems to have a spasm
 with something, and the css hacks for safari are shoddy at best.

 Klaus Hartl wrote:
  I know it still works in 1.3, just wondering why we are advised not to
  use it.

  Because feature detection is much more future proof and stable than
  browser sniffing. With browser sniffing you simply make wrong
  assumptions.

  CSS may be a different beast, although I've never had the need for an
  extra style sheet other than IE, which I include with Conditional
  Comments.

  --Klaus


[jQuery] Re: Thickbox iFrame, 3 links, need box to close and refresh parent page

2008-08-23 Thread wick

It's nothing that fancy, try adding target=_parent on the links,
which will target the parent window of Thickbox's iframe. That should
do the trick.

-Wick
http://www.CarComplaints.com


On Aug 22, 5:33 pm, DRoss [EMAIL PROTECTED] wrote:
 Doh2...the above code just refreshes the page.

 I need the parent page to grab the link from the thickbox window and
 go to it. Any ideas?


[jQuery] Re: How to queue up ajax requests?

2008-07-17 Thread wick

partner[etc],

 Currently, when the pan ends, an onEnd event is fired, which then
 fires off the ajax. So what you're suggesting is that i queue the pan
 onEnd events?

Nope, I think. Back to your pan-pan-pan-pan-pan situation, doing
what you suggest would still fire 5 times (onEnd fires after each
individual pan)  correct?

What Shawn actually suggested (and from your reply, sounds like
you may not have understood) was to delay executing your ajax request
until a setTimeout timer expires. If another pan event happens during
the timeout period, you reset the timeout  start the timer over. So,
that's not a queue. The beauty with the timer is you don't flood the
server with useless requests. I've used the timeout trick for ajax
requests triggered by hover events on table rows. Same situation as
yours - it only makes sense to do the ajax request when the user takes
a 200ms (or whatever you think is appropriate) break. If you
appreciate good UI design, throw a loading indicator up immediately
(during the timeout period) to indicate to the user that something is
happening.

If you are worried about your ajax response taking longer than 200ms
or whatever you use for the timer delay, then you'll need the ajax
request queue solution too of course, but judging from your
discussion, the timeout method will take care of 99% of the problem 
it's more direct fix for the problem as you described it.

-Wick
http://www.CarComplants.com

On Jul 16, 9:47 pm, partner56290674 [EMAIL PROTECTED]
wrote:
 I suppose shawn we can just agree to disagree because your comments
 about it's application specific, IMO, is completly misguided in this
 topic. IMO, it's not application specific but a option for any
 developer to use. I don't see it as something very specific, no more
 than jquery having an @each syntax thingy. I read your comment as 'i
 want to do this and i don't know how, so jQuery, can you do this for
 me because i don't know how/can't be bothered'. Even the next reply is
 doing some queuing, so i can't be THAT far removed. If it's in the
 Core, then it's assumed it's an important wrapper to help developers
 maximize the technology they are using.

 After all this, though ... this is my personal opinion of how i see
 things against yours .. and neither of us are wrong or write .. it's
 personal opinion.

 The topic asked if this functionality was in the core - and it's not.
 I suppose you're 100% right in seeing if John Resig and the krew think
 this is an important option which could see benefit from the
 community... or just more debate.

 :)


[jQuery] Re: Thickbox on 1.2.6 or best alternative?

2008-06-10 Thread wick


Hi Shane, I'm curious what's broken about Thickbox 3.1 using jQuery
1.2.x? I'm running it with jQuery 1.2.3,  with 1.2.6 on the dev
server. I didn't encounter any problems that I recall,  I don't
remember modifying any of the Thickbox code. What issues did you run
into? Is there any other public discussion about this that I missed?

Thanks
-Wick



On Jun 5, 8:25 pm, Shane Graber [EMAIL PROTECTED] wrote:
 What are people using today to create effects like thickbox or
 lightbox on jQuery 1.2.6?  Thickbox is broken on the 1.2.x release and
 I'm stuck with an old version of jQuery until I find a suitable
 replacement.  What are others using?

 --
 Shane ∞http://liquid.homelinux.org
 -
 I'm so cool I can be used to prove Bose-Einstein Condensation!


[jQuery] Re: Select option value

2008-06-03 Thread wick


To answer your question as far as what is _wrong_ with your code -
AFAIK, you can't mix an object reference (variable)  a text string
within a single jQuery selector parameter. You have the right idea
though. Modifying what you had just a little will work:

  var spName = $(option:selected,current).val();

.. which matches option:selected within the context of your
current object reference. Using that second selector parameter is a
good idea whenever you have a this object reference available where
you're selecting children of that object... it cuts down the amount of
work jQuery has to do.

What Michael Geary suggested definitely works fine with all modern
browsers. A lot of developers I know still prefer to use the old-
school method of getting the value of the selected option though, for
no very good reason anymore except habit.

-Wick
CarComplaints.com


On Jun 2, 12:35 am, andyGr [EMAIL PROTECTED] wrote:
 Hi All,

 Here is a simple code:

 select onchange=specify(this) ...
 option./option
 option./option
 ..
 option./option
 /select

 How can I get the value of the selected option? I tried

  function specify(current){
  var spName = $j(current+ option:selected).val();
  alert(spName);

  }

 But it returns undefined value. What is wrong here?

 Thanks
 --
 View this message in 
 context:http://www.nabble.com/Select-option-value-tp17592925s27240p17592925.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Get input value from a loaded page

2008-05-19 Thread wick


Do you have an example page? As ferdjuan mentioned, the usual issue is
with the timing - i.e. your hidden input #counter  its value aren't
available until to the parent page until after your ajax .load()
finishes up.

In terms of troubleshooting, you don't need to echo your php variable
because you can easily see it's being set - view the HTML source. As
long as you see it there, your hidden input value is being passed via
ajax along with all the rest of the HTML code.

I'd start by alerting $('#counter').length from the parent page,  see
if it's matching any elements. Remember timing is an issue so for any
troubleshooting, you'd also have to use .load()'s callback function or
make a test function that runs when you click a link (so you can run
it AFTER you see your ajax page finish loading).

Hope that helps! Again, I'd suggest you put up a quick test page if
you still need help. Good luck,

-Wick
http://www.CarComplaints.com



On May 18, 1:05 pm, dearste [EMAIL PROTECTED] wrote:
 the loaded page is top.php , where $Count; is set.
 regards

 On 18 Mag, 12:22, dearste [EMAIL PROTECTED] wrote:

  ok,
  in top.html, below inpu type..., i have added  ?=echo $Count;?, and
  yes, php var is set in top.html.
  How to pass it in main page with a jquery .load??

  On 18 Mag, 08:21, ferdjuan [EMAIL PROTECTED] wrote:

   Is your script which processes the $Count variable (I assume it's a
   page hit checker?) being included before the line: $
   (#top).load(top.htmll);? If the assignment for $Count is made at
   the wrong time, and then you .load an html file I don't think $Count
   will have any value. Immediately below the line input
   type=hidden... add ?=echo $Count;? and see if it actually has a
   value, if nothing echoes rethink your timing of processes.


[jQuery] Re: jqModal and Rounded Corners

2008-04-03 Thread wick


If you don't have any luck with jqModal, try the Impromptu plugin. I
believe it serves the same purpose as jqModal  rounded corners are
easy:
$.prompt(  ).children('#jqi').corner();
or if you use the plugin's prefix parameter, change the ID selector
above to match your prefix, or use:
$.prompt(  ).children('div:eq(1)').corner();

http://trentrichardson.com/Impromptu/index.php
see example 11

Hope that helps.

-Wick
http://www.CarComplaints.com


On Apr 2, 12:00 pm, Dustin [EMAIL PROTECTED] wrote:
 I am using jqModal and am trying to get the window to have rounded corners.

 Does anyone know of a way to accomplish this?

 Thanks for any help you can provide.
 --
 View this message in 
 context:http://www.nabble.com/jqModal-and-Rounded-Corners-tp16447295s27240p16...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: better examples for UI DatePicker?

2008-04-03 Thread wick

Hi Marc - I couldn't agree more, the functionality  range of options
for DatePicker is incredible, especially considering how complicated a
calendar app is. I should have mentioned that in my first post.

Ironically in looking around for other DatePicker styles, I ran across
your blog entry about Google using DatePicker UI  saw you wrote, I
think the simple skin provides an easy way to adopt the datepicker's
look and feel into web applications, but I think that we need new
skins for the datepicker. If anyone wants to contribute designs please
let me know. Amen :)

With so many features, it seems odd to me that there isn't some sort
of style library or at least more polished skins available - that's
the only area I can think of where DatePicker is lagging. Thinking out
loud, would you consider having a design competition, similar to what
happened with the jQuery logo? It could be a nice way to involve the
community of people using DatePicker. What I meant by detrimental to
DatePicker's success is with better skins available, I think
DatePicker would appeal more to folks looking for a drop-in solution
- mainly beginners  anyone short on time - I imagine that's a fairly
wide segment of potential DatePicker users especially now that jQuery
is mainstream.

Thanks for the reply  the great plugin.

-Wick
http://www.CarComplaints.com


On Apr 3, 10:57 am, 1Marc [EMAIL PROTECTED] wrote:
 wick, I made that default skin and there is no offense taken.  The
 idea behind the default skin was to not use images, allowing people to
 make up their own as easy as possible.  I've seen some AMAZING styles
 for UIDatepicker, but unfortunately they were proprietary (someone
 paid them and owns rights) to the skins. Overall there has been much
 praise about how easy it is to customize UIDatepicker'sskin vs other
 datepickers.  However, recently I received a better default theme and
 will integrate it soon -- so you won't have to hold your breathe for
 too long!

 I don't think it has been bad fordatepicker'ssuccess either, because
 it is the functionality that we have poured our hearts into.  There
 are 50+ customization options and almost 30 translations for a
 reason.  Optimization (faster and smaller code base) is the main
 priority right now, but I will be updating the default theme as well.
 I've been wanting to create a whole suite of themes too, but that will
 come when motivation strikes.

 Thanks for your feedback,

 Marc Grabanskihttp://marcgrabanski.com

 On Apr 2, 2:38 pm, wick [EMAIL PROTECTED] wrote:

  No one has any better styles done? That hurts.

  On Apr 1, 8:44 am, wick [EMAIL PROTECTED] wrote:

   No offense to anyone involved with creating the default examples, but
   I think the default and especially the alternate UIDatePicker
   styles are awful. I realize they are meant to be a starting point for
   people to customize. In theory that sounds like a good idea, but in
   reality it's probably detrimental toDatePicker'ssuccess. Customizing
   the calendar [and doing it well] takes a fair amount of CSS/graphic
   design work  I doubt many jQuery users have the skills and/or the
   time.

   For those who aren't familiar with them, Calendar for MooTools' three
   default styles are phenomenal (link below) - clean, professional 
   modern looking. Compare them to theDatePickerdefault styles  you'll
   see what I'm talking about. I'd love to see a calendar style of
   similar quality available for UIDatePicker.

   jQuery UIDatePicker:http://marcgrabanski.com/code/ui-datepicker/
   (click the Stylesheets tab for the alternate style example .. pretty
   clunky)
   MooTools Calendar:http://www.electricprism.com/aeron/calendar/

   Anyone have any better examples of UIDatePickerstyles?


[jQuery] Re: better examples for UI DatePicker?

2008-04-02 Thread wick

No one has any better styles done? That hurts.

On Apr 1, 8:44 am, wick [EMAIL PROTECTED] wrote:
 No offense to anyone involved with creating the default examples, but
 I think the default and especially the alternate UI DatePicker
 styles are awful. I realize they are meant to be a starting point for
 people to customize. In theory that sounds like a good idea, but in
 reality it's probably detrimental to DatePicker's success. Customizing
 the calendar [and doing it well] takes a fair amount of CSS/graphic
 design work  I doubt many jQuery users have the skills and/or the
 time.

 For those who aren't familiar with them, Calendar for MooTools' three
 default styles are phenomenal (link below) - clean, professional 
 modern looking. Compare them to the DatePicker default styles  you'll
 see what I'm talking about. I'd love to see a calendar style of
 similar quality available for UI DatePicker.

 jQuery UI DatePicker:http://marcgrabanski.com/code/ui-datepicker/
 (click the Stylesheets tab for the alternate style example .. pretty
 clunky)
 MooTools Calendar:http://www.electricprism.com/aeron/calendar/

 Anyone have any better examples of UI DatePicker styles?


[jQuery] Re: still confused, but a little more organised

2008-02-10 Thread wick


Hey Cherry, I like the new page layout! I have one comment about your
Methods: $().append section that I thought might be confusing to
people. It's just a technicality.

You write, I wanted to replace my h1 heading with an image. But,
using .append() does not literally replace your h1 heading text,
rather, it adds on (yes, appends!) to anything contained in your h1
tag. Using the .append() code in your example, you end up with:

h1 insnoscriptHeader Text/noscript/insimg . //h1
.. which works fine, but as you can see technically your header text
isn't replaced. It's been appended onto.

Another more straightforward way to accomplish what you're after is
this HTML:
h1Header Text/h1
.. and this Javascript:
$('h1').html('img . /');

.. This way your Header Text is replaced by the image. The .html()
method replaces anything inside the selected tags. This way is
validation-friendly and degrades gracefully if someone has Javascript
disabled. For more information on other similar DOM manipulation
methods, see this link - there's a bunch:
http://docs.jquery.com/Manipulation

-Wick
CarComplaints.com



On Feb 9, 9:18 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 About a week ago, I volunteered to blog my efforts at learning jQuery
 - I seem to be finding it more troublesome than most beginners! Some
 of you were encouraging (thank you VERY much!) but you all said it
 made a confusing read.

 Well, to an extent I can't fix that because the author *is* confused!
 However, I've done a whole new page for it, with nested topics  all.
 I hope it's easier to follow??

 http://jquery.cherryaustin.com

 There is a comments box and I'll add proper contact facilities if
 anybody reads it ;)

 Cheers, and thanks as ever for all your help :)
 Cherry.

On Feb 9, 9:18 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 About a week ago, I volunteered to blog my efforts at learning jQuery
 - I seem to be finding it more troublesome than most beginners! Some
 of you were encouraging (thank you VERY much!) but you all said it
 made a confusing read.

 Well, to an extent I can't fix that because the author *is* confused!
 However, I've done a whole new page for it, with nested topics  all.
 I hope it's easier to follow??

 http://jquery.cherryaustin.com

 There is a comments box and I'll add proper contact facilities if
 anybody reads it ;)

 Cheers, and thanks as ever for all your help :)
 Cherry.


[jQuery] Re: yet another beginner's diary (pls review!)

2008-02-05 Thread wick


Hi Cherry - I enjoyed reading your blog. It's especially interesting 
informative to read what issues jQuery newcomers come across.

One issue that it seemed you may not have grasped is when to escape
characters. This isn't something specific to jQuery - it's actually a
Javascript-wide issue, but you run across it a lot with jQuery.

It's simple once you realize what's going on: You only need to escape
characters within data when they are the same as the character you're
using to surround (define) the data. Basically you are preventing
Javascript from being confused about the start  end of the data.

Simplifying the replace text with an image example in your blog a
bit:
$('h1').append('..');
...Here you are using single quotes to define the parameter data for
append, so you only need to escape any single quotes that are within
your parameter data. There are none, so it's not necessary to escape
anything. For consistency's sake, in your example the double quote
after fullinfo.html is missing a backslash. But, it doesn't matter
since again for that example, you don't need to escape double quotes
at all.

You've inadvertently discovered this: it's a great idea to use single
quotes to define the parameter data when using HTML code, since
usually you don't need to escape anything (unless there are single
quotes in your HTML). If you're defining a something like a sentence
containing single quotes, it's best to use double quotes to define it
since you don't have to escape the single quotes:
$('h1').append(Here's a sentence that's got some single
apostrophes.);
...again because I'm using double quotes to define the start/end of
the sentence, only double quotes within the sentence will cause
problems. There are none, so I'm all set.

Taking one more look at your example, I've changed the title to
contain some single quotes. Both of these examples will work, but I
prefer the 2nd one since there's a lot less escaping to be done.

$('h1').append(img src=\/images/headertext.gif\ alt=\alt text\
title=\Here's a great site. It's awesome.\ longdesc=\http://
something.com/fullinfo.html\ /);
$('h1').append('img src=/images/headertext.gif alt=alt text
title=Here\'s a great site. It\'s awesome. longdesc=http://
something.com/fullinfo.html /');

Hope that makes (more?) sense.

-Wick
CarComplaints.com


On Feb 3, 11:54 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Seriously, I beg for your opinions/corrections/suggestions ...

 http://cherry.austin.googlepages.com/home

 Cherry


[jQuery] Re: animation: sequential showing / hiding : how-to?

2007-12-16 Thread wick


Here's the method I use on my site (modified a bit to fit your
example), there's probably a better way, but my version is pretty
clean:

function showitems(i,max) {
  if (i = max) {
$('div.items:eq('+i+')').show('slow',function() { showitems(+
+i,max) });
  }
}

$(function() {
  showitems(0,$('div.items').length);
});

It's a neat effect, I use it on my site CarComplaints.com for instance
here:
http://www.carcomplaints.com/Ford/Focus/2001/


On Dec 16, 6:15 pm, Alexandre Plennevaux [EMAIL PROTECTED]
wrote:
 hi!

 i'm displaying a series of graphical items in one command:

 $('div.items).show(slow);

 now, it was suggested by my mate that they appear one after the other,
 according to, say, their order of appearance in the html markup.

 of course i could use the callback of each show so taht the next one only
 start when current is finished animating, but i don't know in advance the
 amount of divs there will be so i'm kind of stuck on how to achieve that.

 Has anyone achieved something like that? Any clue would be useful.

 Thank you,

 --
 Alexandre


[jQuery] css overflow issue with jQuery animation effects

2007-12-15 Thread wick

I ran into a CSS issue with jQuery effects - some of the animations
add the overflow property for the duration of the effect. In FF2 - but
not IE7 - the overflow property changes the box model behavior. As far
as I can tell, the box model change caused by the overflow property is
part of the CSS2 spec.

It's a problem in this situation:
- div A is floated left
- div B is not floated  has a left margin greater than the width of
div A.
- div B is animated using jQuery (show, hide, slideUp, slideDown etc)

Test page here: http://www.carcomplaints.com/test/overflow.html

Anyone know of a clean way around this issue? I'm tempted to apply
overflow: hidden permanently to the affected elements  ditch the
left margin altogether, but it seems like there should be a better
way. Pretty frustrating since the layout that causes the problem is
simple  common. Any suggestions?


[jQuery] Re: How to get an html page not knowing its address

2007-11-09 Thread wick


Sounds like you're talking about cross-domain scripting which as
Richard mentioned, isn't possible with AJAX requests - the
jquery .load() command uses AJAX, so what Richard is saying is it's
simply not possible to use jQuery's .load() to access an html file on
a different domain. With AJAX, the file you access must be on the same
domain as the page that's trying to access it - that security
restriction is built into all modern web browsers.

There's another way to load information dynamically (not using AJAX)
from files hosted on other domains as long as they are javascript
code, but it sounds like you want something that can access files
containing html code.

The type of request you are are asking about is usually handled using
a server-side programming language. With server-side languages like
PHP or Perl etc you can easily make an HTTP request to any page on any
domain  store/process the result.

With PHP I believe you'd use Curl:
http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl
http://us2.php.net/manual/en/ref.curl.php

With Perl you'd use LWP:
http://www.perl.com/pub/a/2002/08/20/perlandlwp.html

One way to accomplish your request is to make a server-side proxy
script. Basically here's how that works - your web page makes an AJAX
request to the proxy script, which in turn makes the cross-domain HTTP
request,  then returns the result to your page via AJAX. AJAX works
for this because the proxy script is on the same server as your web
page. Keep in mind there are security implications about making a
proxy that accesses any page on any other domain - you'd probably want
to come up with a method so that your proxy script can only be
accessed by your web page. Here's an article about that method:
http://fleegix.org/articles/2005/11/07/cross-domain-ajax-requests

Hope that helps!
-Wick


On Nov 8, 9:59 am, caruso_g [EMAIL PROTECTED] wrote:
 Ciao Richard,
 thanks a lot, really.

 It, clearly, works.

 But, if I may ask you more, if I would to pass an address with the
 same problem to a jQuery selector, what should I write?
 Would it enough to create a variable and insert its name into the
 selector?
 Below it is an example:

 var my_variable_name = '' + document.location.hostname + '/folder/
 subfolder/file.html';

 jQuery(my_variable_name).something;

 Would it be right? That is just to learn.
 Thanks anyway again for your help.

 On Nov 8, 3:02 pm, Richard D. Worth [EMAIL PROTECTED] wrote:

  No need to provide the full URL, including the domain/server name. In fact,
  there's a security restriction on Ajax that prevents fetching an html page
  from a domain other than the current one, so you only need to specify a
  relative url to load:

  jQuery('#footer-navbar').load(/clients/clickadvisor-02/snippets/footer-
  navbar.html);

  - Richard

  On Nov 8, 2007 6:04 AM, caruso_g [EMAIL PROTECTED] wrote:

   I should have made progresses, I hope.

   I saw that it would be better to use .load method to get some simple
   pre-formatted html bunch of code.

   But the problem is still there, I don't know how to pass as arguments
   a domain address I am not able to know in advance.
   So I tried with the code below, but it doesn't work:

  function address() {
  var website = document.location.hostname;
  var snippet_address = '' + website +
   '/clients/clickadvisor-02/
   snippets/footer-navbar.html';
  document.write(snippet_address);
  }

  jQuery('#footer-navbar').load(address(););

   Any suggestion?

   On Nov 7, 10:45 pm, caruso_g [EMAIL PROTECTED] wrote:
First of all I want to apologize with all devs out there for my
questions. I am sure that solution will be easy but I am just a
designer, so I am a moron with Javascript...

The problem is that I need to put some html code into a div (#footer-
navbar) getting the html code from a page of which I already know its
hierarchy (clients/clickadvisor-02/snippets/footer-navbar.html) but of
which I don't know its domain (http://www.I_DONT_KNOW_THIS.COM).
I tried to create a script with jQuery like this:

jQuery('#footer-navbar').html(function () {
  jQuery.get(function () {
document.write('' + this.location.hostname + 'clients/
clickadvisor-02/snippets/footer-navbar.html')
});

});

Where do I make a mistake?

Thanks in advance to everyone.

ps
I am making use of jQuery because of some incompatibilities with
other libraries.



[jQuery] Re: jQuery UI Datepicker v3.0 Released! (Previously named jQuery Calendar)

2007-11-05 Thread wick

@Micha - If you look closer at popwincal  the differences, I think
it's a bit more complicated than that. I agree with Graeme - the thing
I like best about popwincal is the simpler/slicker header area, mainly
the fact that popwincal fits the important date controls onto one,
clean thin control area. Granted some changes like the colors, images
for next/prev  removing the calendar borders is easy via CSS like you
mentioned, and a few of the the other differences like 3-letter day
abbreviations can be accomplished through Datepicker config options.

However Popwincal does not use select boxes for the month  year
dropdowns which would make styling those items a lot more flexible.
Also the way the Datepicker html is coded, there's a container div
wrapped around the month/year section that also includes the calendar
table, which makes it nearly impossible to cleanly arrange the prev/
next controls in the same horizontal area as the month/year control,
like popwincal has.

Some feature requests  other comments:
- a few config options for the positioning behavior would be great, to
control: 1) where the calendar flys out (i.e. to the side of the
trigger element rather than below)  2) enable/disable the auto-
reposition based on available screen area.

- a config option to turn off the day-of-the-week links. Neat feature
but it seems to me like a lot of users would click on a day header by
accident  find the reorganized calendar confusing.

Thanks for the plugin, awesome job.

On Nov 1, 11:08 am, Michael Stuhr [EMAIL PROTECTED] wrote:
 Graeme B. Davis schrieb: Is there a way to apply a style it so that it looks 
 a bit better?  Perhaps
  like this calendar I've been using on my sites for ~6yrs:

 http://www.ssw.com.au/ssw/Standards/DeveloperGeneral/Images/popupCale...
  f
 http://www.peterbe.com/plog/blogitem-20031017-1526/popwincal

  I like the jquery calendar, but feel it doesn't look as good as it could...

 no offense, but:
 have you even looked at the example site ?

 there's a tab that says Stylesheets. I guess that's (nearly) all you need.

 micha



[jQuery] Re: jQuery UI Datepicker v3.0 Released! (Previously named jQuery Calendar)

2007-11-05 Thread wick

I was just looking through the code  noticed my a config option to
turn off the day-of-the-week links feature request is already
implemented. Nice! I missed it in the option documentation.


On Nov 5, 8:59 am, wick [EMAIL PROTECTED] wrote:
 @Micha - If you look closer at popwincal  the differences, I think
 it's a bit more complicated than that. I agree with Graeme - the thing
 I like best about popwincal is the simpler/slicker header area, mainly
 the fact that popwincal fits the important date controls onto one,
 clean thin control area. Granted some changes like the colors, images
 for next/prev  removing the calendar borders is easy via CSS like you
 mentioned, and a few of the the other differences like 3-letter day
 abbreviations can be accomplished through Datepicker config options.

 However Popwincal does not use select boxes for the month  year
 dropdowns which would make styling those items a lot more flexible.
 Also the way the Datepicker html is coded, there's a container div
 wrapped around the month/year section that also includes the calendar
 table, which makes it nearly impossible to cleanly arrange the prev/
 next controls in the same horizontal area as the month/year control,
 like popwincal has.

 Some feature requests  other comments:
 - a few config options for the positioning behavior would be great, to
 control: 1) where the calendar flys out (i.e. to the side of the
 trigger element rather than below)  2) enable/disable the auto-
 reposition based on available screen area.

 - a config option to turn off the day-of-the-week links. Neat feature
 but it seems to me like a lot of users would click on a day header by
 accident  find the reorganized calendar confusing.

 Thanks for the plugin, awesome job.

 On Nov 1, 11:08 am, Michael Stuhr [EMAIL PROTECTED] wrote:

  Graeme B. Davis schrieb: Is there a way to apply a style it so that it 
  looks a bit better?  Perhaps
   like this calendar I've been using on my sites for ~6yrs:

  http://www.ssw.com.au/ssw/Standards/DeveloperGeneral/Images/popupCale...
   f
  http://www.peterbe.com/plog/blogitem-20031017-1526/popwincal

   I like the jquery calendar, but feel it doesn't look as good as it 
   could...

  no offense, but:
  have you even looked at the example site ?

  there's a tab that says Stylesheets. I guess that's (nearly) all you need.

  micha



[jQuery] Re: Catfish Advert Plugin

2007-10-04 Thread wick


That bottom padding makes it so all the normal page content appears
above the catfish advert - in other words you can scroll to the bottom
of the normal page  the content at the very end isn't covered up by
the ad - the padding goes behind the catfish ad.


On Oct 3, 3:42 am, Kia Niskavaara [EMAIL PROTECTED] wrote:
 Is this line really necessary:

 $('html').css('padding', '0 0 ' + this.settings.height + 'px 0');

 It seems as if it changes the padding of the whole page.

 I also wonder what happens if the user doesn't support cookies. I think the 
 best solution would be
 not to display the ad at all.

 sozzi wrote:
  Hmm seems the demos etc don't work. The only place I could find it
  with a short search was here:

 http://www.nextbbs.com/trac/nbbs/browser/trunk/helpers/extjs/plugins/...

  And I'm not exactly sure if that is the last version.

  On Oct 2, 6:12 am, Kia Niskavaara [EMAIL PROTECTED] wrote:
  I'm unable to download the Catfish Advert Plugin 
  fromhttp://www.jqueryplugins.com/plugins/view/1/-
  does anyone have the source?

  Kia



[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-16 Thread wick

 It seems more intuitive and consistent than:

 $('#foo')[0].className;
 $('#foo')[0].size;
 $('#foo')[0].type;

If you're repeatedly accessing the first DOM object of a jQuery
selector array, it's a good practice to set a variable:

var myObject = $('#foo')[0];

..then you can access DOM properties like you're used to doing,  also
save the browser from the duplicate object lookups:

myObject.className
myObject.size
myObject.type

-Wick
CarComplaints.com