[jQuery] Re: Add events and functions to ajax content

2008-07-16 Thread hubbs

Ok, so it sounds like I need to rebind when my new elements are
added.  Strangely the .bind() example is not even using bind.

This is the example:
 $('a').click(fn);
 $('#mydiv').load('my.html',function(){
   $('a').click(fn);
 });

Is this the best way to do what I need, or are some of the other
options better for this, such as livequery?

On Jul 15, 5:06 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 On Jul 15, 2008, at 6:47 PM, hubbs wrote:



  I have some html that is brought in through ajax which itself has some
  jquery functions attached to it.  These are not working unless I
  include a document ready in the content that is pulled through with
  ajax.  This in turn conflicts with my pages jquery document load.  Is
  there a way to avoid this?

 This is a great question, and a frequently-asked one, too:

 http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...

 Let us know if you still need help after having read the answer. :)

 --Karl
 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com


[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.

2008-07-16 Thread Jörn Zaefferer

The formatItem implementation is wrong. You are returning the
JavaScript object for the row (item) instead of a String to display.
Try return item.Name.

Jörn

On Wed, Jul 16, 2008 at 1:28 AM, shapper [EMAIL PROTECTED] wrote:

 Sorry for the delay ...

 I just changed the file. Check it now.


 On Jul 15, 9:37 pm, Jörn Zaefferer [EMAIL PROTECTED]
 wrote:
 Firebug shows an error when I enter something. Can't debug it with the
 compressed script - replace that with the uncompressed one and we may
 get somewhere.

 Jörn

 On Tue, Jul 15, 2008 at 9:35 PM, shapper [EMAIL PROTECTED] wrote:

  Hi,

  Here it is:
 http://www.27lamps.com/Beta/AutoComplete/TagsUpdate.aspx

  And I kept the previous one:
 http://www.27lamps.com/Beta/AutoComplete/Tags.aspx

  Thank You,
  Miguel

  On Jul 15, 6:09 pm, Jörn Zaefferer [EMAIL PROTECTED]
  wrote:
  Please put the commented code back in. The current one is rather useless.

  Jörn

  On Tue, Jul 15, 2008 at 4:31 PM, shapper [EMAIL PROTECTED] wrote:

   Does anyone knows how to solve this problem?

   Please, check my example in:
  http://www.27lamps.com/Beta/AutoComplete/Tags.aspx

   On Jul 14, 9:57 pm, shapper [EMAIL PROTECTED] wrote:
   Jörn,

   I just uploaded an ASP.NET application that shows exactly what the
   problem was.
   The commented script code is the one I used to try to solve my problem
   but it does not work:

  http://www.27lamps.com/Beta/AutoComplete/Tags.aspx

   What should I do?

   Thanks,
   Miguel

   On Jul 14, 6:02 pm, Jörn Zaefferer [EMAIL PROTECTED]
   wrote:

Learn to use Firebug - as I mentioned, the ajax request returns a 
404.
It still does. Please come back when you have an actual JavaScript
problem.

Jörn

On Mon, Jul 14, 2008 at 6:16 PM, shapper [EMAIL PROTECTED] wrote:

 Jörn,

 I just uploaded all your example to my server and the json example
 does not work:
http://www.27lamps.com/Labs/AutoComplete/demo/json.html

 None of the remote works ... have no idea why.

 The same happens with my example:
http://www.27lamps.com/Labs/AutoComplete/demo/tags.html

 Anyway, all I am trying to make work is remote example where the 
 JSON
 returned is as follows:
 [{TagID:017b253e-596b-4328-85f5-
 fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]},
 {TagID:3fae2160-55f6-4dd0-b856-
 fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]},
 {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática
 B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61-
 b03a-
 e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}]

 I am not familiar with PHP but I created the following:
 ?php
 $q = strtolower($_GET[q]);
 if (!$q) return;

 echo [;
  echo {TagID:017b253e-596b-4328-85f5-
 fd97a783759c,Name:Física,FileTags:[],ProfessorTags:
 []},;
  echo {TagID:3fae2160-55f6-4dd0-b856-
 fd27f5d307e2,Name:Matemática,FileTags:
 [],ProfessorTags:[]},;
  echo
 {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática
 B,FileTags:[],ProfessorTags:[]},;
  echo {TagID:f183cb9d-9d92-4c61-b03a-
 e51cc1205b2b,Name:Português,FileTags:
 [],ProfessorTags:[]}];
 echo ];

 And my AutoComplete code is as follows:
 script type=text/javascript
$(document).ready(function(){

  $(#tag).autocomplete(tags.php, {
autoFill: true,
cacheLength: 1,
multiple: true,
scrollHeight: 200,
selectFirst: false,
width: 260,
parse: function(data) {
return $.map(eval(data), function(row) {
return {
data: row,
value: row.Name,
result: row.Name
}
});
},
formatItem: function(item) {
return item;
}
  });

});
 /script

 This is what I have been using to try to find the problem in
 AutoValidate so then I can fix the problem in my ASP.NET MVC 
 project.

 Thanks,
 Miguel

 On Jul 14, 4:40 pm, Jörn Zaefferer [EMAIL PROTECTED]
 wrote:
 Open firebug and look at the request being send. A 404 is 
 returned.

 Jörn

 On Mon, Jul 14, 2008 at 5:15 PM, shapper [EMAIL PROTECTED] 
 wrote:

  That was a mistake when I uploaded the files ... I sent two 
  wrong
  files.
  I just updated the files:

 http://www.27lamps.com/Labs/AutoComplete/demo/tags.html

  Again it does not work.

  On Jul 14, 3:28 pm, Jörn Zaefferer [EMAIL PROTECTED]
  wrote:
  You forgot the document ready code.

  Jörn

  On Mon, Jul 14, 2008 at 4:07 

[jQuery] Sending a JSON object as data in an AJAX request

2008-07-16 Thread jlb

According to the jQuery docs, the data option (in $.ajax) is supposed
to accept a string or an object (which it then converts to a query
string).  It appears as though its not converting my object:


My Javascript is:

var json = {
  Request : {
  action : doSomething,
  params   : {id:123}
  }
   };

$.ajax({
type: POST,
url: WEB_DOMAIN + /api.php,
data: json
});

In api.php contains:

 ?php var_dump($_REQUEST['Request']); ?

Which outputs:

string(15) [object Object]


Does anyone know what I'm doing wrong?


[jQuery] Re: $.post problem. need help badly

2008-07-16 Thread iTsadok

Pappa Bear, note that the original problem was that upon executing
return true the submit action would take the browser to a new page.
Kirov (if I understood him correctly) suggested to wait for a result
code from the POST request before returning true. Now, in Java for
example, I would take this suggestion literally and do something like:

postRequest.wait();
return true;

Assuming that postRequest is an object which performs the POST action
and then calls this.notify() - I hope you get my drift.

In Javascript, since the concurrency model is different, there is no
such mechanism, and as you said you need to use ajax for this. So you
start an ajax request, return false, and try to simulate the effects
of return true in the ajax success() or error() callbacks. In our
case this means calling $(form).submit(), but I can think of more
complicated situations where the solution is not that obvious. What if
we're in the middle of a recursion? Then, you have to start talking
about stuff like continuations and nobody likes that.

In case my last point was not clear, consider this function:

function scanTree(subtree) {
for (node in subtree) {
if(! existsOnServer(node)) return;
console.log(node);
scanTree(subtree[node]);
}
}

How would you implement existsOnServer with an ajax request?

Sorry for rambling,
Israel

On Jul 15, 6:34 pm, Pappa Bear [EMAIL PROTECTED] wrote:
 You can with ajax... depending on the result that is returned, you can
 have your script perform various things. If the result returns with a
 success for the call, you can call one thing, while if returns a
 failure, you can, say alert the user with a message. Even single
 threads allow for multiple routes. Every language has to wait for some
 result or another before continuing along its path. You can't just
 tell a program, for instance, to add 2 numbers, but continue with the
 script before it finishes. That would make no sense. Maybe I
 misunderstood your response, but that is what it sounds like you are
 saying.

 Also, jquery has actions for success and failure's of AJAX actions...

 On Jul 15, 1:54 am, iTsadok [EMAIL PROTECTED] wrote:

  You can't wait for a result before returning, there is no waiting
  mechanism (only timers) and Javascript is single-threaded anyway, so
  nothing will happen until you return.
  What you should do is return false, and perform a manual submit of the
  form once the POST is done. Now, this might be tricky, since just
  calling submit() on the form will call the bound handler, thereby
  creating an infinite loop. So you either need to unbind the handler,
  or have an if statement and some sort of state.

  As a simplified example, this should do the trick (haven't tested it,
  sorry) for a form with id form1:

  $(#form1).bind(submit, save_data, function() {
      var bound_form = $(this);
      $.post(/save_data.php, { name: opt-in name, email: opt-in
  email }, function() {
          bound_form.unbind(submit, save_data).submit();
      });

  });

  Note that after the submit happens the handler would no longer be
  bound to the submit event, but in your case it doesn't matter, since
  you're going to a different page anyway.

  On Jul 14, 5:59 pm, Kirov [EMAIL PROTECTED] wrote:

   I think you should wait for a result code from the post request before
   you return true; otherwise the post is handled asynchronously and
   perhaps not done according to your plans :)

   Good luck;

   On Jul 14, 4:49 pm, Sandy [EMAIL PROTECTED] wrote:

hi,

i wanna try to save the data from a form to a database before
submitting it to it's rightful action url. this is an opt-in form i
wanna work on.

i did this: $(form:last).bind(submit, submit_optin);
/* i altered the submit event of the opt-in form so it uses the
submit_optin function i created */

here's the submit_optin function:
var submit_optin = function(){
   var pbform = {name:opt-in name, email: opt-in email}; // this
is jus a sample data to be saved.
   $.post(http://www.myurl.com/save_data;, pbform);
   return true; // return true so it submits the form to it's rightful
action url (which is a url from a different domain/server)

};

now for the MAIN PROBLEM... if i set submit_optin to return false it
saves the data but if i set it to return true it just submits the form
without saving the data... now is there a way to stop and wait before
it saves the data before it submits the form? or is there any way i
can achieve my goal?

please help, thanks :-)


[jQuery] Re: yet again XML+jQuery+IE7

2008-07-16 Thread Tzury

 If that's the exact code you're using, then you should first convert the XML
 string into a jQuery object, like this...

 xml = $(' {xml goes here} ');



Diego, John
I changed my snippet as follows and it is still works only in FF, not
in IE7

script src=jquery.js/script
script
var xml = NewDataSet
  + Table1
  +  aHello/a
  +  bjQuery/b
  + /Table1
+ /NewDataSet;
xml = $(xml);
alert($(Table1, xml).text());
/script


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

2008-07-16 Thread partner56290674

it's possible to possibly wait for the user to stop panning.
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?

secondly, i still am confused to why u think jQuery should not offer
this support because you believe this is bad. Remember, the idea of
ajax is to stop an entire page from loading/refreshing and only
retrieving the data that has changed. It's very simple to look at a
page and see three _independent_ sections that have 3 different ajax
calls .. but please don't forget scenario's like mine .. or even one
of the most common scenario's - autocomplete .. we're there's multi
requests to the same ajax service .. where the _option_ of queueing
could be available for those who worry.

but anyways, you've answered my question :) time to hunt around for
stuff...


[jQuery] jqModal clear fields

2008-07-16 Thread johannesF

Hi all

I use the jqModal, and I want to clear some fields in the modal window
after opening. Cant get it to work so some advise would be perfect.

Like this

var open = function(hash){
$(#myFiled).val('').show();
};

$('#dialog').jqm({
overlay: 8,
onShow: open
});



/ johannes


[jQuery] Error callback executed after XHR.abort()

2008-07-16 Thread thomasjbradley

Basically my error callback on the ajax request is still being
executed after I have called the abort() method on the Xhr.

I am creating a live search function.
On our development server, we don't have access to the live server, to
retrieve the ajax response.
So the error callback is executed after 45 seconds (our timeout
length).
Even after the Xhr is aborted, the error callback is still executed.
Everything works properly on the Live server, because the Ajax is
getting a response before timing out.

This is basically how the code is set up: ( Lots removed for brevity )

// Textbox has a timeout, and the search function is called after 850
milliseconds of not typing
concertFinder.timeout = setTimeout( 'concertFinder.resortGenres()',
850 );

// I then check if an Xhr is already executing, and abort it if it is
if( this.xhr ){
this.xhr.abort();
}

// I then execute the ajax request
this.xhr = $.ajax({
url: theUrl,
type: 'GET',
dataType: 'json',
timeout: 45000,
error: function( XMLHttpRequest, textStatus, errorThrown ){ },
success: function(json){}
});


An example:

Say I am typing in the search field and pause for 850 ms.
An Ajax request will start.
I then start typing again and pause.
Another Ajax request will start up.
Now I would assume that the first request would stop all its execution
(Firebug stops twirling for that request)
But after the 45 second timeout, the first Ajax request's error
callback is executed.

Then again the second error callback is executed, because the time
between the request initialisations is only about a second.

Does anyone have any ideas?
Oh I should mention that I tried the Ajax Manager plugin--with
AbortOld--and the same problem occurred.


[jQuery] Fade To with nested items?

2008-07-16 Thread YWFTDG

Hey guys, I am having an issue with the fadeto function and with
multiple items. I have:

$(document).ready(function(){
$(#content div).fadeTo(slow, 0.5);

$(#content div).hover(function(){
$(this).fadeTo(fast, 1.0);
},function(){
$(this).fadeTo(fast, 0.5);
});

});

Then on my page, I have the main div (#content) and then divs in
there. I am trying to fade up the div on rollover, but the issue is
this div has another div in it. When it fades up, it doesn't fade up
the nest div, unless I roll over that div, then they are both faded
up. Inside the second div is a span as well. Its actually fading
everything, but I want all items inside the div target ( id=?=$row-
pId?) to all fade up. My nested div is like this:

 div id=?=$row-pId? style=float: left;
div id=title
span style=z-index: 99; position:absolute;Project
Title/span
/div
/div

Any ideas/ solutions?



[jQuery] problem server?

2008-07-16 Thread fengxia

Hi tony

   Do you think there is the problem of the server for the site
www.trirand.com/jqgrid ou www.trirand.com/blog
I can't connect it


[jQuery] jquery 1.2.6 animations and firefox 3

2008-07-16 Thread vipworld

Did anyone notice some jerkiness in animations with this combo? I have
a fade in that's smooth in firefox 2, but when I run it in firefox 3,
it doesn't really fade.

Thanks!


[jQuery] Re: yet again XML+jQuery+IE7

2008-07-16 Thread Tzury

 xml = $(' {xml goes here} ');


added xml = $(xml); (see below)
still not working on IE7

script src=jquery.js/script
script
var xml = NewDataSet
  + Table1
  +  aHello/a
  +  bjQuery/b
  + /Table1
+ /NewDataSet;

xml = $(xml);

alert($(Table1, xml).text());

/script


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

2008-07-16 Thread Shawn


partner56290674 wrote:

secondly, i still am confused to why u think jQuery should not offer
this support because you believe this is bad. Remember, the idea of


I think it is inappropriate because you are describing an application 
specific issue.  Not all applications will have the same needs.  The 
requirement is not general enough (IMO) to be made part of the jQuery 
framework.  Your needs and my needs are similar, but still very 
different.  Do you try to handle ALL possibilities in the framework, or 
provide the tools for the developers to solve their own needs?


Additionally, you *could* set up jQuery to monitor the page for change 
requests, but that is just one approach.  Typically web pages are event 
driven, and those events trigger ajax calls if/when needed.  You 
mentioned the autocomplete - this is a great example here.  If a user 
starts typing, do you send an ajax request for EVERY keystroke, or do 
you introduce a slight delay to find when the user has paused in typing, 
and THEN send the ajax request with the changed text?  (note that no 
queue is needed at all)  That is a judgment call needed by the 
application developer.  Most autocomplete solutions introduce the delay, 
but there may be legitimate times when this is not desired.  (simple 
select instead of autocomplete maybe?)


It still comes down to the individual developer knows best what they 
need.  The framework should only provide the generic tools to help the 
developer solve those needs - NOT try to solve all developers needs in 
one package.


But this is all just opinion.  I'll leave those decisions to John Resig 
and the rest of the core developers...


My random thoughts

Shawn


[jQuery] Re: problem server?

2008-07-16 Thread Tony

All should work now.
Regards
Tony

fengxia wrote:
 Hi tony

Do you think there is the problem of the server for the site
 www.trirand.com/jqgrid ou www.trirand.com/blog
 I can't connect it


[jQuery] jQuery n00b needs a (seemingly) simple thing...

2008-07-16 Thread Miiitch


Sorry I'm such a n00b. I have only done a couple of things with jQuery, just
real simple stuff.
Anyways, here's what I need:

I need a SIMPLE slideshow/carousel script.
It should be able to automatically slide between images (actually slide,
like the image moves all the way to the left) every x amount of milliseconds
Also, there has to be a pause button, and forward/backwards buttons.

So, if it's auto-sliding the pictures, and you see one you like, you can
pause and look at it for longer, then hit play and keep going, or click the
forward/backward buttons to move one image at a time.

Does it make sense?
I've tried a few different plugins, nothing seems to have what I need.

Any help is appreciated.
Thanks

-Miiitch
-- 
View this message in context: 
http://www.nabble.com/jQuery-n00b-needs-a-%28seemingly%29-simple-thing...-tp18483567s27240p18483567.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Need help with div selection

2008-07-16 Thread zerowing

How can I select the #blc2?

HTML
div id=blc1
pSome text/p
/div

div class=openBloc
div id=blc2
  h1strongSome title/strong/h1
   /div
/div

Script
$(document).ready(function(){
  $('div#blc1').ifixpng();
  $('.openBloc   #blc2').ifixpng();

 });

CSS
#blc1 {
 Background:URL(../img/blc-1.png) no-repeat;
 Display:block;
 Height:100px;
 Width:498px;
}
.openBloc #blc2 {
 Background:URL(../img/blc-active.png) no-repeat;
 Display:block;
 Height:192px;
 Width:498px;
 Padding:16px 0 0 20px;
}
.closeBloc #blc2 {
 Background:URL(../img/blc-2-3.png) no-repeat;
 Display:block;
 Height:28px;
 Width:498px;
 Padding:16px 0 0 20px;
}


[jQuery] jquery bug in IE6 - scroller

2008-07-16 Thread subwayslim

Hi,

i have been working on a scroller, it's a bit messy design wise, but
i'm still working on it
http://www.subwayslims.co.uk/scroller_example.html

the Jquery function seems to work on iE7 and FF but not in IE6, does
anyone know why it doesn't work...??



[jQuery] Re: Calling PHP Functions from jQuery?

2008-07-16 Thread Isaak Malik
Also, file management can be improved drastically by sorting everything in
folders and using namespacing.

I put the AJAX API's in a separate file and if it's getting to big I create
a separate API file for each functionality, for example:
API/API.feedback.php
API/API.updater.php
etc.

On Tue, Jul 15, 2008 at 8:55 PM, Andrew [EMAIL PROTECTED] wrote:


 The really proper way to do this is with XML-RPC or JSON-RPC, which
 is probably what you really want as you're already using JSON.  RPC
 means remote procedure call.  The basics are pretty well illustrated
 on the wikipedia page here:
 http://en.wikipedia.org/wiki/JSON-RPC

 There are a variety of good libraries for doing this in PHP, as well.



 On Jul 14, 7:11 am, Yavuz Bogazci [EMAIL PROTECTED] wrote:
  Hi,
 
  is it possible to call php functions from jquery? I knew how to call
  a .php page from jquery with $.post and to echo output or return a
  JSON Object. But my application growth and there is an increase in
  single php pages. This is very confusing and the filemanagement is
  getting complicated.
 
  How are you solving this problem? Is a good tutorial or info out
  there? I have searched google and couldnt find a useful answer.
 
  thank a lot
  yavuz




-- 
Isaak Malik
Web Developer


[jQuery] Re: jScrollPane - maintainPosition malfunction

2008-07-16 Thread ikspel

I think this is caused by the vertical offset of the
jScrollPaneContainer DIV, by no means do I guarantee this fix but it
seems to work...for me at least:-)...

Line 64 of jScrollPane.js dated 2008-02-17 is:

var currentScrollPosition = settings.maintainPosition ?
$this.offset({relativeTo:jQuery(this).parent()[0]}).top : 0;


You can get the vertical offset of jScrollPaneContainer with:

jQuery(this).parents(.jScrollPaneContainer).offset().top


So if you take that away from the currentScrollPosition
maintainPosition seems to work:

var currentScrollPosition = settings.maintainPosition ?
$this.offset({relativeTo:jQuery(this).parent()[0]}).top -
jQuery(this).parents(.jScrollPaneContainer).offset().top : 0;

hope that helps



[jQuery] jquery bug in IE6 - scroller

2008-07-16 Thread subwayslim


Hi,

i have been working on a scroller:
http://www.subwayslims.co.uk/scroller_16_07.html
the Jquery function seems to work on iE7 and FF but not in IE6, does
anyone know why it doesn't work...??

-- 
View this message in context: 
http://www.nabble.com/jquery-bug-in-IE6---scroller-tp18484587s27240p18484587.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: bug .append adds unwanted start tags to end tags

2008-07-16 Thread spx2

Thanks,

I've spotted the problem.
It was due to other problems.

On Jul 16, 3:59 am, Karl Rudd [EMAIL PROTECTED] wrote:
 The HTML code you pass in to the append/prepend/etc functions gets
 converted to actual DOM nodes first, then it gets added to the DOM
 tree. This effectively means you can only append/prepend/etc whole
 tags. This isn't a bug.

 If you want to wrap a bunch of tags in another tag use the wrapAll 
 function:

  http://docs.jquery.com/Manipulation/wrapAll

 Karl Rudd

 On Wed, Jul 16, 2008 at 10:32 AM, Stefan Petrea [EMAIL PROTECTED] wrote:

  Hi,

  I've noticed recently while trying to use .append that
  for example when I append a /p tag in reality jQuery
  appends p/p.
  I consider this a bug.
  Is it expected behaviour ?
  What should I do ?

  Thank you

  --

  Stefan Petrea
  homepage :http://perlhobby.googlecode.com/
  mobile phone : +40732070179


[jQuery] Insert new DOM element with new ID (index)?

2008-07-16 Thread Doover

Hello. I trying to do a function that add a li element with a new
number (index) each time a link is clicked.

The current jQuery code looks like this:


$('.new').livequery('click', function() {
$('.item').each(function(index) {
$('.new').before('li class=item' + (index+2) + 'Item ' + 
(index
+2) + '/li');
});
return false;
});



HTML code look like this:


li class=item1/li

a href=# class=new title=New ItemNew Item/a



It works fine the first time I click on New Item but then it starts
to duplicate each line. So if I have added two lines it adds four,
then eight and so on.

Any help are extremely appreciated. Thank you very much!

Best regards,
Joakim


[jQuery] netvibes type sign in plugin

2008-07-16 Thread gaurav_ch

Hi all,

I want to know whether we have anything like http://www.netvibes.com/#General
sign in form thing. I mean to say that I want to create a form which
comes into focus when the user clicks a button and the background
fades. They are using mootools but I want to use jquery.

Thanks,

Gaurav

P.S. - Jquery rocks.


[jQuery] mixing validate, and ajaxSubmit

2008-07-16 Thread Andiih

The behaviour I have is that the form is correctly validated, but
submits


$('#editjobsform').submit(function()  {dosavejob();   return
false; });
//other stuff here
$('#editjobsform').validate(
{ rules: {blah:blah   },
  messages: {   blah: blah} }
);
//other stuff here
function dosavejob() {
$('#editjobsform').ajaxSubmit({  // editjobsform action=/srv/
coms2.asmx/getJobs
beforeSubmit: ShowBusy,
success: DoneSaveJob,
dataType: 'xml',
error: function(XMLHttpRequest, textStatus, 
errorThrown)
{NotFound(); ClearBusy();}
});
return false;
}

I've tried changing the order of the .submit and .ajaxSubmit but to no
avail.  Chaining them loses the .ajaxSubmit behaviour and I ended up
looking the xml returned by my web service.

The documentation mentions submitHandler which might do the trick, but
isn't docuemented in the API documentation section.

Speaking of which, there appear to be some classes which cause
validation to occur ('required' 'url' 'date') but again these are not
documented: or am I missing something ? [other than reading the source
code]

TIA

Andrew


[jQuery] Re: ClientSide Cookie or ServerSide Cookie

2008-07-16 Thread Isaak Malik
If the settings are manipulated via client-side code there is no need for
cookies created by the server-side and this would actually be a bad thing to
do unless really needed (e.g. you need the server to know the change
immediately). Here is the cookie plugin:

http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/

There are many cases where creating cookies from the client-side is a better
solution to the server-side alternative but this really depends on your code
and how you want to use it.

On Tue, Jul 15, 2008 at 10:59 PM, [EMAIL PROTECTED] wrote:


 Dear Folks ,
 I have to save some of the settings of my Users with the cookies ,
 I've done this before with PHP Cookie Header .. right now I was
 Wondering If I could that with jQuery instead of PHP ... which one is
 Practical ... is there any Example for the jQUery cookie ...
 thanks Pedram




-- 
Isaak Malik
Web Developer


[jQuery] Re: Why does IE not cache images?

2008-07-16 Thread Diego A.
Hi Christian,

It seems this problem can only be fixed by changing your server's behaviour.

IIS: http://www.milonic.com/mfa/2005-February/ie6-not-caching-images.html

 In IIS under properties for the folder /images/menu HTTP HEADERS was set to
 Enable Content Expiration. Turning this off now allows the images to be
 cached correctly.


Apache: http://ahinea.com/en/tech/ie-dhtml-image-caching.html

Other useful link:
http://blog.httpwatch.com/2008/02/27/image-caching-in-internet-explorer/

* Stupid IE6 *

2008/7/16 Chris [EMAIL PROTECTED]:


 Hi list,
 I recently started using jQuery after working with plain JavaScript
 for several years. The features of jQuery are amazing!
 Now I have found a problem regarding IE's handling of dynamically
 created images. It is not really jQuery related, but maybe you can
 help me anyway.
 I have the following code snippet:

 $(document).ready(function() {
for (var i = 0; i  100; i++)
$('body').append('img src=images/b_edit.png
 title=Edit');
 });

 As you can see, this code creates 100 *identical* images; however, IE
 loads each image separately. (I can see it in the log file of my web
 server and it also takes a considerable time until the page is fully
 loaded.) Is there any way to change this behavior?
 If I put all the images directly in my document (not generating them
 dynamically) the image is only loaded once, but this is not an option
 for me.

 Thanks a lot,
 Christian

 P.S.: I use IE 6.0.




-- 
Cheers,
Diego A.


[jQuery] Re: Need help with div selection

2008-07-16 Thread Giovanni Battista Lenoci


zerowing ha scritto:

How can I select the #blc2?

HTML
div id=blc1
pSome text/p
/div

div class=openBloc
div id=blc2
  h1strongSome title/strong/h1
   /div
/div

Script
$(document).ready(function(){
  $('div#blc1').ifixpng();
  $('.openBloc   #blc2').ifixpng();

 });
  

An HTML id should be unique, then it could be simply : $('#blc2');

:-)

--
gianiaz.net - web solutions
p.le bertacchi 66, 23100 sondrio (so) - italy
+39 347 7196482 



[jQuery] Fall back to IFRAMEs with jQuery

2008-07-16 Thread [EMAIL PROTECTED]

Hi All,

I know this is a question which is really old news, but we have a site
where some of our users have centralized security settings, and their
ActiveX has been switched off and of course they can not use IE7. they
are proud IE6 users.

I have had a look at plenty of  old libraries that uses IFRAMEs I
tried one of them but absolutelly does not work together with jQuery.

does anyone know a way of doing this ?

Any help is very welsome !

Istvan


[jQuery] Re: Fall back to IFRAMEs with jQuery

2008-07-16 Thread Dan G. Switzer, II

Istvan:

I know this is a question which is really old news, but we have a site
where some of our users have centralized security settings, and their
ActiveX has been switched off and of course they can not use IE7. they
are proud IE6 users.

I have had a look at plenty of  old libraries that uses IFRAMEs I
tried one of them but absolutelly does not work together with jQuery.

does anyone know a way of doing this ?

Any help is very welsome !

I assume you're referring to AJAX/XHR support. If so and Flash is a valid
alternative, then check out:

http://ajaxian.com/archives/flxhr-flash-based-xhr-from-flensed

I've not used, but it's designed to be a drop-in replacement for the XHR
that's supposed to be cross browser compliant. They also claim to have
updated hooks to most libraries (including jQuery.)

-Dan



[jQuery] Re: Cycle Plugin - multiple instances on same page?

2008-07-16 Thread Mike Alsup



On Jul 15, 4:22 pm, wdm [EMAIL PROTECTED] wrote:
 Any way to have several slideshows on the same page, each with their
 own independent navigation (prev/next), without giving them unique
 ids?

 Couldn't get this working:

 $('.gallery').each(function() {

         var p = this.parentNode;

         $(this).cycle({
                 fx:             'scrollHorz',
                 speed:  'slow',
                 timeout: 0,
                 next:   $('a.next-image', p)
         });

 });


That looks like it should work, assuming you have an anchor with a
next-image class within the gallery parent.  Can you post a link?


[jQuery] Re: jQuery Validation Opera Issue

2008-07-16 Thread Nimrod

I tried the latest version but still have the said issue.

On Jul 15, 11:36 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Please checkout the latest revision or wait for the next release
 (1.4), the issue is fixed 
 there.http://dev.jquery.com/view/trunk/plugins/validate/

 Jörn

 On Tue, Jul 15, 2008 at 3:21 PM,Nimrod[EMAIL PROTECTED] wrote:

  I used a text area as one of the field inside my form. I didnt put any
  validation rule on it but why i am receiving a validation message
  Please enter no more than 0 characters. ? This only appears on
  Opera.

  Any idea?




[jQuery] Re: mixing validate, and ajaxSubmit

2008-07-16 Thread Jörn Zaefferer

Put the ajaxSubmit stuff into the submitHandler-callback, here is an
example: 
http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html

Jörn

On Wed, Jul 16, 2008 at 11:29 AM, Andiih [EMAIL PROTECTED] wrote:

 The behaviour I have is that the form is correctly validated, but
 submits


$('#editjobsform').submit(function()  {dosavejob();   return
 false; });
 //other stuff here
$('#editjobsform').validate(
{ rules: {blah:blah   },
  messages: {   blah: blah} }
);
 //other stuff here
function dosavejob() {
$('#editjobsform').ajaxSubmit({  // editjobsform action=/srv/
 coms2.asmx/getJobs
beforeSubmit: ShowBusy,
success: DoneSaveJob,
dataType: 'xml',
error: function(XMLHttpRequest, textStatus, 
 errorThrown)
 {NotFound(); ClearBusy();}
});
return false;
}

 I've tried changing the order of the .submit and .ajaxSubmit but to no
 avail.  Chaining them loses the .ajaxSubmit behaviour and I ended up
 looking the xml returned by my web service.

 The documentation mentions submitHandler which might do the trick, but
 isn't docuemented in the API documentation section.

 Speaking of which, there appear to be some classes which cause
 validation to occur ('required' 'url' 'date') but again these are not
 documented: or am I missing something ? [other than reading the source
 code]

 TIA

 Andrew



[jQuery] Re: Multiple Instances of the same effect without unique IDs

2008-07-16 Thread Joe S

Hi Karl,
Thanks so much for the help - it definitely got me in the right
direction. Here's what I ended up with inside the (document).ready
function:

$(.extraContent).hide();  // hide the extra stuff by default

$('div.contentWrapper').click(function() { // contentWrapper DIV,
contains a[TITLE]/a and .extraContent DIV
  $(this).find('.extraContent').slideToggle();  // slide toggles
the .extraContent DIV within the .contentWrapper
});

it all seems to work; clicking one leaves the others untouched;
clicking multiple works as it should. i was getting weird thing
happening with the 'td:first-child' approach. is anything i'm doing
terribly bad form?

again, thanks!


On Jul 15, 7:51 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Hi Joe,

 Assuming that the additional information that you're initially hiding  
 is in a span tag, I'd do something like this:

 $(document).ready(function() {
    $('td:first-child').click(function() {
      $(this).find('span').slideToggle();
    });

 });

 --Karl
 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Jul 15, 2008, at 2:04 PM, Joe S wrote:



  I know this has got to be in here somewhere; I'm not familiar enough
  with jQuery syntax to know what a valid search string is (i keep
  looking for EACH and THIS and MULTIPLE but I'm not returning anything
  useful). So I apologize that my noob stripes are showing through...

  I've got (basically) a table looking like:

  Title          |  Release Date  |   Revised Date | Contact
  ---
  ---
  Apples       |    08-2005     |    09-2006     | John Smith
  ---
  Bananas    |    08-2005     |    09-2006     | John Smith
  ---
  Oranges     |    08-2005     |    09-2006     | John Smith

  I'm trying to add the ability to toggleSlide a (initially) hidden div
  under each individual [TITLE] without triggering the rest of the
  hidden content *AND -- if possible* without assigning a unique ID to
  each title/content pair (I could make it work that way, but these
  update a lot, and keeping track of the last unique value is a chore).

  For example, clicking on Apples would reveal:

  Title           |  Release Date  |   Revised Date | Contact
  ---
  ---
  Apples        |    08-2005        |    09-2006       | John Smith
  Apples are  |
  Tasty.         |
  ---
  Bananas     |    08-2005     |    09-2006     | John Smith
  ---
  Oranges     |    08-2005     |    09-2006     | John Smith

  SO... I need some way of saying:

  [click a title  reveal the corresponding content  click it again to
  hide it] leaving the rest of the table in tact

  Sound doable, or should I just go the unique ID route? Thanks in
  advance!


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

2008-07-16 Thread Scott Russell

On Tue, 2008-07-15 at 21:46 -0700, partner56290674 wrote:
 it's possible to possibly wait for the user to stop panning.
 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?

I recently needed some queuing and handled it as:

1) Define var array e_pending to hold events in queue
2) Define var int e_concurrent to handle max events that could run at
once
3) Define var int e_running to say how many requests were running

As events come in I add them to e_pending array. When adding an event
here I also check if runQueueTimer is set and fire off a function called
runQueue() that processes the events in the e_pending array if it isn't.

In the runQueue() function I first check to see if e_running 
e_concurrent. If so, I trigger another ajax call and increment
e_running. The return handlers for the ajax call will decrement
e_running upon completion. Before existing runQueue(), I set the timer
runQueueTimer when:

  a) timer isn't already set
  b) e_running != 0
  c) count of e_pending !=0 

runQueueTimer is set for something like 1 or 2 seconds in my app. When
multiple events come in this has the nice effect of spacing out the
requests sent to the server. And of course, this avoids tight CPU
sucking JS loops on the client side as well.

I really miss JavaScript not having sleep() but this worked out well.

 secondly, i still am confused to why u think jQuery should not offer
 this support because you believe this is bad. Remember, the idea of
 ajax is to stop an entire page from loading/refreshing and only
 retrieving the data that has changed. It's very simple to look at a
 page and see three _independent_ sections that have 3 different ajax
 calls .. but please don't forget scenario's like mine .. or even one
 of the most common scenario's - autocomplete .. we're there's multi
 requests to the same ajax service .. where the _option_ of queueing
 could be available for those who worry.
 
 but anyways, you've answered my question :) time to hunt around for
 stuff...



[jQuery] Re: [validate] Dynamic forms and input naming

2008-07-16 Thread ldodds

Hi Jörn,

OK, that sounds reasonable. I did some experimenting after I sent the
original email and found that the unique naming issue was the
real issue, not the form being dynamic: even a simple form such
as:

form
 input id=a1 type=text name=example value=/
 input id=a2 type=text name=example value=/
 input type=submit/
/form

...which is perfectly valid HTML, causes the plugin problems.

I've already poked around in the code so will see if I can propose
a concrete way forward. The obvious solution seems to be to rely on
id
attributes instead, with a fallback to name if thats not found.
That should resolve the issue and give you some backwards
compatibility.

Cheers,

L.

On Jul 15, 6:15 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 The plugin is architectured around unique names, so there is no
 obvious way out. The plugin is already quite tolerant in respect to
 dynamic forms, so this is a worthwhile topic. I'd be happy to
 collaborate with you on this, where you do the research and we try to
 find a solution based on that, together.

 By research I'm referring to an extensive code review, looking for the
 various places where element names are used, and how they could be
 modified to remove the unique requirement (eg. indexing in the
 internal data structures).

 Jörn

 On Tue, Jul 15, 2008 at 5:12 PM, ldodds [EMAIL PROTECTED] wrote:

  Hi,

  I've built a dynamic form that I want to validate using the JQuery
  validate plugin. However I've hit a snag which I think is related to
  how I'm naming form elements. I wondered whether anyone else has had
  the same problem (or might have a solution!)

  The dynamic aspects of the form are implemented with a little
  microformat and a use of the JQuery clone() method. I have something
  like:

  div class=repeated
   input type=text name=ex:email value=/
  /div

  My code picks up on repeated form sections and adds some controls to
  enable to the user to add/remove sections to the form. In this case,
  the ability to add multiple email addresses. That bit works fine.

  What I want to do is just add class=required email to markup, and
  have each individual email address be validated.

  However at the moment the JQuery Validate plugin treats all of the
  inputs as the same, i.e. if I click to add a second email address
  field, with the first value being invalid and the second valid, then
  the plugin seems to only ever be validating the original value.

  I think this is because the plugin is using the field name attributes
  as a key?

  Yes, the obvious answer is to give all the controls unique names, but
  I'd like to avoid that if possible as the field names are used
  elsewhere and I'd rather avoid having to munge them to add/remove a
  unique suffix (e.g. ex:email-1).

  Any ideas?

  Cheers,

  L.
  --
 http://www.ldodds.com/blog


[jQuery] Re: NEW: XML to JSON Plugin

2008-07-16 Thread chris thatcher
Oh and now that I'm reading my response I forgot to mention these characters
in xml names, '-' (minus) and '.' (dot).  Obviously not legal tender in the
js arena.  The only thing I can think of here is to not map to a legal js
name and force the associative array usage, eg via foo['bar-goop']

Ugh
Thatcher

On Wed, Jul 16, 2008 at 9:46 AM, chris thatcher 
[EMAIL PROTECTED] wrote:

 FORMAT:
 Yeah I agree the {}/[] issue complex and after going another round with
 xotree I have to say I really like the 'force_array' map it optionally
 allows.  That said the asArray() solution works and I might like it even
 better once I'm using it becuase I'm totlly Lazy ;)

 ATTRIBUTES:
 if you want to encourage dot notation for attributes, the best thing to do
 is look at what is legal for js names but not for xml names and basically
 your left with '$'.  The bigger issue occurs with the use of ':' in xml
 names is legal but obviously not for js and in fact an xml name can even
 start with ':' or '_' as well.  The underscore isn't an issue but if you
 want a quick replace method to go from attribute xml to js name and back the
 easiest way may be

 xml attribute name to js name
 1 prefix by '$' to denote an attribute
 2 replace all ':' with '$'

 js name to xml attribute name
 1 remove prefix '$'.
 2 replace all '$' with ':'

 This keeps it clean for the simple no-namespaced xml, but still lets us
 namespace dorks keep using namespaces and still access our attributes.

 eg no namespace
 foo.bar.$goop

 eg namespaced
 foo.bar.$svg$goop

 What do you think?

 OVERALL:
 I agree with your approach and coming from a heavy xml background and still
 using stuff like this for wierd/ugly/legacy xml means I need to not loose
 info.  I say make the simplest cases very elegant like you've already
 described and I'll help make sure that the critical xml info is still
 identifiable so we can round-trip non-lossy.

 MIXED CONTENT
 I generally don't think tools like this are very useful for mixed content
 like foo bar goop blah=ugh/ pooh /foo but I was curious if you
 wanted to try to address this or just note it as unsupported.

 Thatcher

 On Wed, Jul 16, 2008 at 5:27 AM, Diego [EMAIL PROTECTED] wrote:


 Hi Chris,

 FORMAT:
 I set the 'simple mode' (arrays only when necessary) as default
 because it suited my usage of the plugin. I completely see the
 argument of always using arrays so the format of the output is always
 known (ie.: in arrays), but I do have a reservation about that. I
 think in most cases the user will know what the XML structure and
 defaulting the plugin to 'simple mode' will result in a neater and
 more intuitive interface: response.result instead of
 response[0].result[0].text.

 As for nodes which are expected to be arrays, there's no reason why -
 along with our .find utility method - we can't have an asArray()
 method that will, if necesssary, convert the node into an array. This
 saves having to parse a pre-defined format and also avoids any lazy
 programming - ie.: only do something when you need it.

 ATTRIBUTES:
 At the moment, I purposely built the plugin to treat text nodes and
 attributes exactly the same, meaning your example xml and my example
 xml would end up as the same json. The idea of prefixing all
 attributes @ is great, but @ is not a valid js variable character and
 could only be accessed via person.hair['@colour'] instead of
 person.hair.colour. So it might be worth considering an alternative
 which does not involve any extra characters

 OVERALL:
 My focus really has been on usability. I've gone out of my way to
 'hide' the technicalities of the XML and keep the JSON as simple as
 possible. I agree it will have to get a little more complex if we're
 going to implement this additional functionality and support json to
 xml conversion, but it would be great if we can find a way to do
 both

 Cheers,
 Diego A.


 On Jul 16, 3:17 am, chris thatcher [EMAIL PROTECTED]
 wrote:
  On Tue, Jul 15, 2008 at 4:01 PM, Diego A. [EMAIL PROTECTED] wrote:
   Hi Chris,
 
   AJAX:
   Yeah actually I think it's normally sufficient to let the user use
 jquery
   ajax as usual but just provide easy functions to unmarshal/marshal
 into the
   format they need where ever they need it.  It reduces the size of the
 plugin
   and I've sort of found most ajax-convenience functions in plugins
 aren't
   exactly what I need so I end up not using them anyway.  Not always
 true
   though and if you think there some benefit I really don't feel very
 strongly
   either way (just playing devils advocate.)
 
   We need not re-invent the wheel. I think it would be fair to assume
 users
   of this plugin will have a certain amount of experience and would be
 quite
   capable (and would probably prefer) to write their own ajax calls,
 like
   this...
   $.get(url2xml, function(response){
var json = $.xml2json(response);
// do stuff
   });
 
   Having said that, it would be very easy to assume that an ajax call is

[jQuery] Re: NEW: XML to JSON Plugin

2008-07-16 Thread chris thatcher
FORMAT:
Yeah I agree the {}/[] issue complex and after going another round with
xotree I have to say I really like the 'force_array' map it optionally
allows.  That said the asArray() solution works and I might like it even
better once I'm using it becuase I'm totlly Lazy ;)

ATTRIBUTES:
if you want to encourage dot notation for attributes, the best thing to do
is look at what is legal for js names but not for xml names and basically
your left with '$'.  The bigger issue occurs with the use of ':' in xml
names is legal but obviously not for js and in fact an xml name can even
start with ':' or '_' as well.  The underscore isn't an issue but if you
want a quick replace method to go from attribute xml to js name and back the
easiest way may be

xml attribute name to js name
1 prefix by '$' to denote an attribute
2 replace all ':' with '$'

js name to xml attribute name
1 remove prefix '$'.
2 replace all '$' with ':'

This keeps it clean for the simple no-namespaced xml, but still lets us
namespace dorks keep using namespaces and still access our attributes.

eg no namespace
foo.bar.$goop

eg namespaced
foo.bar.$svg$goop

What do you think?

OVERALL:
I agree with your approach and coming from a heavy xml background and still
using stuff like this for wierd/ugly/legacy xml means I need to not loose
info.  I say make the simplest cases very elegant like you've already
described and I'll help make sure that the critical xml info is still
identifiable so we can round-trip non-lossy.

MIXED CONTENT
I generally don't think tools like this are very useful for mixed content
like foo bar goop blah=ugh/ pooh /foo but I was curious if you
wanted to try to address this or just note it as unsupported.

Thatcher
On Wed, Jul 16, 2008 at 5:27 AM, Diego [EMAIL PROTECTED] wrote:


 Hi Chris,

 FORMAT:
 I set the 'simple mode' (arrays only when necessary) as default
 because it suited my usage of the plugin. I completely see the
 argument of always using arrays so the format of the output is always
 known (ie.: in arrays), but I do have a reservation about that. I
 think in most cases the user will know what the XML structure and
 defaulting the plugin to 'simple mode' will result in a neater and
 more intuitive interface: response.result instead of
 response[0].result[0].text.

 As for nodes which are expected to be arrays, there's no reason why -
 along with our .find utility method - we can't have an asArray()
 method that will, if necesssary, convert the node into an array. This
 saves having to parse a pre-defined format and also avoids any lazy
 programming - ie.: only do something when you need it.

 ATTRIBUTES:
 At the moment, I purposely built the plugin to treat text nodes and
 attributes exactly the same, meaning your example xml and my example
 xml would end up as the same json. The idea of prefixing all
 attributes @ is great, but @ is not a valid js variable character and
 could only be accessed via person.hair['@colour'] instead of
 person.hair.colour. So it might be worth considering an alternative
 which does not involve any extra characters

 OVERALL:
 My focus really has been on usability. I've gone out of my way to
 'hide' the technicalities of the XML and keep the JSON as simple as
 possible. I agree it will have to get a little more complex if we're
 going to implement this additional functionality and support json to
 xml conversion, but it would be great if we can find a way to do
 both

 Cheers,
 Diego A.


 On Jul 16, 3:17 am, chris thatcher [EMAIL PROTECTED]
 wrote:
  On Tue, Jul 15, 2008 at 4:01 PM, Diego A. [EMAIL PROTECTED] wrote:
   Hi Chris,
 
   AJAX:
   Yeah actually I think it's normally sufficient to let the user use
 jquery
   ajax as usual but just provide easy functions to unmarshal/marshal
 into the
   format they need where ever they need it.  It reduces the size of the
 plugin
   and I've sort of found most ajax-convenience functions in plugins
 aren't
   exactly what I need so I end up not using them anyway.  Not always
 true
   though and if you think there some benefit I really don't feel very
 strongly
   either way (just playing devils advocate.)
 
   We need not re-invent the wheel. I think it would be fair to assume
 users
   of this plugin will have a certain amount of experience and would be
 quite
   capable (and would probably prefer) to write their own ajax calls, like
   this...
   $.get(url2xml, function(response){
var json = $.xml2json(response);
// do stuff
   });
 
   Having said that, it would be very easy to assume that an ajax call is
   required when a function is sent in one of the parameters, for example:
   $.xml2json(url2xml, function(json){
// do stuff
   });
   ... which doesn't really save (or cost) much time (or code) but it
 provides
   a simple little hook for Ajax calls. :-D
 
  +1
 
 
 
 
 
   FORMAT:
   Where it really became an issue in a production environment was that I
   always had to test every 'element' to see if i needed to 

[jQuery] Re: Multiple Instances of the same effect without unique IDs

2008-07-16 Thread Joe S

OK, spoke too soon... on further testing, I'm getting an unintended
(but really stupid, on my part) side effect...

if i put another anchor in the hidden content (a link to a file or
site, for example), the toggle is triggered on that click, too (since
it's in the wrapper DIV, right?). so, in a single table cell, i've
got:

div class=contentWrapper
   a href=#[TITLE of CONTENT]/a
  div class=extraContent
 a href=foo.comMy File/a
 a href=bar.comAnother Site/a
  /div
/div

I need to click the title  expose the extraContent  and click the
links in the extraContent without triggering the toggle. is there way
to either adjust what i'm listening for (the click of the [Title]) or
ignore clicks within the extraContent (again, without resorting to
unique IDs for each row)?

--joe





On Jul 16, 8:59 am, Joe S [EMAIL PROTECTED] wrote:
 Hi Karl,
 Thanks so much for the help - it definitely got me in the right
 direction. Here's what I ended up with inside the (document).ready
 function:

 $(.extraContent).hide();  // hide the extra stuff by default

 $('div.contentWrapper').click(function() {     // contentWrapper DIV,
 contains a[TITLE]/a and .extraContent DIV
   $(this).find('.extraContent').slideToggle();  // slide toggles
 the .extraContent DIV within the .contentWrapper

 });

 it all seems to work; clicking one leaves the others untouched;
 clicking multiple works as it should. i was getting weird thing
 happening with the 'td:first-child' approach. is anything i'm doing
 terribly bad form?

 again, thanks!

 On Jul 15, 7:51 pm, Karl Swedberg [EMAIL PROTECTED] wrote:

  Hi Joe,

  Assuming that the additional information that you're initially hiding  
  is in a span tag, I'd do something like this:

  $(document).ready(function() {
     $('td:first-child').click(function() {
       $(this).find('span').slideToggle();
     });

  });

  --Karl
  
  Karl Swedbergwww.englishrules.comwww.learningjquery.com

  On Jul 15, 2008, at 2:04 PM, Joe S wrote:

   I know this has got to be in here somewhere; I'm not familiar enough
   with jQuery syntax to know what a valid search string is (i keep
   looking for EACH and THIS and MULTIPLE but I'm not returning anything
   useful). So I apologize that my noob stripes are showing through...

   I've got (basically) a table looking like:

   Title          |  Release Date  |   Revised Date | Contact
   ---
   ---
   Apples       |    08-2005     |    09-2006     | John Smith
   ---
   Bananas    |    08-2005     |    09-2006     | John Smith
   ---
   Oranges     |    08-2005     |    09-2006     | John Smith

   I'm trying to add the ability to toggleSlide a (initially) hidden div
   under each individual [TITLE] without triggering the rest of the
   hidden content *AND -- if possible* without assigning a unique ID to
   each title/content pair (I could make it work that way, but these
   update a lot, and keeping track of the last unique value is a chore).

   For example, clicking on Apples would reveal:

   Title           |  Release Date  |   Revised Date | Contact
   ---
   ---
   Apples        |    08-2005        |    09-2006       | John Smith
   Apples are  |
   Tasty.         |
   ---
   Bananas     |    08-2005     |    09-2006     | John Smith
   ---
   Oranges     |    08-2005     |    09-2006     | John Smith

   SO... I need some way of saying:

   [click a title  reveal the corresponding content  click it again to
   hide it] leaving the rest of the table in tact

   Sound doable, or should I just go the unique ID route? Thanks in
   advance!


[jQuery] Re: AutoComplete and JSon not working as expected. Please, help me out.

2008-07-16 Thread shapper

Hi Jörn,

Thank you for your help ...
In fact I had that before but it was not working so I changed ... I
realized it now that there were two problems:
That one on my AutoComplete code and another one on the methods that
returns the JSON when connecting to the SQL Server.

I was able to spot it using FireBug.

Thanks,
Miguel

On Jul 16, 8:18 am, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 The formatItem implementation is wrong. You are returning the
 JavaScript object for the row (item) instead of a String to display.
 Try return item.Name.

 Jörn

 On Wed, Jul 16, 2008 at 1:28 AM, shapper [EMAIL PROTECTED] wrote:

  Sorry for the delay ...

  I just changed the file. Check it now.

  On Jul 15, 9:37 pm, Jörn Zaefferer [EMAIL PROTECTED]
  wrote:
  Firebug shows an error when I enter something. Can't debug it with the
  compressed script - replace that with the uncompressed one and we may
  get somewhere.

  Jörn

  On Tue, Jul 15, 2008 at 9:35 PM, shapper [EMAIL PROTECTED] wrote:

   Hi,

   Here it is:
  http://www.27lamps.com/Beta/AutoComplete/TagsUpdate.aspx

   And I kept the previous one:
  http://www.27lamps.com/Beta/AutoComplete/Tags.aspx

   Thank You,
   Miguel

   On Jul 15, 6:09 pm, Jörn Zaefferer [EMAIL PROTECTED]
   wrote:
   Please put the commented code back in. The current one is rather 
   useless.

   Jörn

   On Tue, Jul 15, 2008 at 4:31 PM, shapper [EMAIL PROTECTED] wrote:

Does anyone knows how to solve this problem?

Please, check my example in:
   http://www.27lamps.com/Beta/AutoComplete/Tags.aspx

On Jul 14, 9:57 pm, shapper [EMAIL PROTECTED] wrote:
Jörn,

I just uploaded an ASP.NET application that shows exactly what the
problem was.
The commented script code is the one I used to try to solve my 
problem
but it does not work:

   http://www.27lamps.com/Beta/AutoComplete/Tags.aspx

What should I do?

Thanks,
Miguel

On Jul 14, 6:02 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:

 Learn to use Firebug - as I mentioned, the ajax request returns a 
 404.
 It still does. Please come back when you have an actual JavaScript
 problem.

 Jörn

 On Mon, Jul 14, 2008 at 6:16 PM, shapper [EMAIL PROTECTED] wrote:

  Jörn,

  I just uploaded all your example to my server and the json 
  example
  does not work:
 http://www.27lamps.com/Labs/AutoComplete/demo/json.html

  None of the remote works ... have no idea why.

  The same happens with my example:
 http://www.27lamps.com/Labs/AutoComplete/demo/tags.html

  Anyway, all I am trying to make work is remote example where the 
  JSON
  returned is as follows:
  [{TagID:017b253e-596b-4328-85f5-
  fd97a783759c,Name:Física,FileTags:[],ProfessorTags:[]},
  {TagID:3fae2160-55f6-4dd0-b856-
  fd27f5d307e2,Name:Matemática,FileTags:[],ProfessorTags:[]},
  {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática
  B,FileTags:[],ProfessorTags:[]},{TagID:f183cb9d-9d92-4c61-
  b03a-
  e51cc1205b2b,Name:Português,FileTags:[],ProfessorTags:[]}]

  I am not familiar with PHP but I created the following:
  ?php
  $q = strtolower($_GET[q]);
  if (!$q) return;

  echo [;
   echo {TagID:017b253e-596b-4328-85f5-
  fd97a783759c,Name:Física,FileTags:[],ProfessorTags:
  []},;
   echo {TagID:3fae2160-55f6-4dd0-b856-
  fd27f5d307e2,Name:Matemática,FileTags:
  [],ProfessorTags:[]},;
   echo
  {TagID:883b197e-0cb3-4528-8403-0877d742bf47,Name:Matemática
  B,FileTags:[],ProfessorTags:[]},;
   echo {TagID:f183cb9d-9d92-4c61-b03a-
  e51cc1205b2b,Name:Português,FileTags:
  [],ProfessorTags:[]}];
  echo ];

  And my AutoComplete code is as follows:
  script type=text/javascript
     $(document).ready(function(){

       $(#tag).autocomplete(tags.php, {
         autoFill: true,
         cacheLength: 1,
         multiple: true,
         scrollHeight: 200,
         selectFirst: false,
                 width: 260,
         parse: function(data) {
                             return $.map(eval(data), 
  function(row) {
                                     return {
                                             data: row,
                                             value: row.Name,
                                             result: row.Name
                                     }
                             });
                     },
                     formatItem: function(item) {
                             return item;
                     }
                   });

     });
  /script

  This is what I have been using to try to find the problem in
  AutoValidate so then I can fix the problem in my ASP.NET MVC 
  project.

  Thanks,
  Miguel

  On Jul 14, 4:40 pm, Jörn Zaefferer [EMAIL PROTECTED]
  wrote:
  Open firebug and 

[jQuery] Uncompressed, Minified and Gzipped and Packed

2008-07-16 Thread shapper

Hello,

Most JQuery plugins, including JQuery itseld, offer three versions:
Uncompressed,  Minified and Gzipped and Packed.

1. Should I use Minified and Gzipped or Packed?

2. How can I create myself the Minified and Gzipped or Packed
versions from the Uncompressed version?
Is there any software for this?

Thank You,
Miguel


[jQuery] Re: Uncompressed, Minified and Gzipped and Packed

2008-07-16 Thread Andy Matthews

Uncompressed is the raw, human readable, source code for the plugin.

Packed takes the source code and runs it through an algorithmn which
compresses variable names, methods, code, etc into one big line of
javascript. You can find more information about it, and pack your own code,
here:
http://dean.edwards.name/packer/

Minified uses server side compression to further reduce the file size.
Drawback of this method is that your server needs to be equipped to offer
this version, and the file needs to be de-compressed on the client side.


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of shapper
Sent: Wednesday, July 16, 2008 11:30 AM
To: jQuery (English)
Subject: [jQuery] Uncompressed, Minified and Gzipped and Packed


Hello,

Most JQuery plugins, including JQuery itseld, offer three versions:
Uncompressed,  Minified and Gzipped and Packed.

1. Should I use Minified and Gzipped or Packed?

2. How can I create myself the Minified and Gzipped or Packed
versions from the Uncompressed version?
Is there any software for this?

Thank You,
Miguel




[jQuery] Re: Uncompressed, Minified and Gzipped and Packed

2008-07-16 Thread Mika Tuupola



On Jul 16, 2008, at 7:48 PM, Andy Matthews wrote:


Packed takes the source code and runs it through an algorithmn which
compresses variable names, methods, code, etc into one big line of
javascript. You can find more information about it, and pack your  
own code,

here:
http://dean.edwards.name/packer/

Minified uses server side compression to further reduce the file size.
Drawback of this method is that your server needs to be equipped to  
offer
this version, and the file needs to be de-compressed on the client  
side.


Minifying does not use server side compression. Minifying means  
removing all unnecessary characters from source code, without changing  
its functionality.


Minified JavaScript files are usually further packed by gzipping them.  
This is done on the fly by server. Apache comes with mod_deflate  
module by default. This handles gzipping.


Packed files have to be uncompressed on client side too. While gzipped  
files are uncompressed by browser natively, packed files are  
uncompressed calling JavaScript eval() everytime page loads.


--
Mika Tuupola
http://www.appelsiini.net/



[jQuery] Re: Sending a JSON object as data in an AJAX request

2008-07-16 Thread jlb

Just came to the same conclusion.  My intent was to actually send a
stringified version of the JSON object (so im using json2.js from
http://www.json.org).
None the less, thanks Eric!

On Jul 16, 4:51 am, Erik Beeson [EMAIL PROTECTED] wrote:
 HTTP parameters are key/value pairs. If you have an object like:

 var json = {
   foo: 'bar',
   boo: 'far'

 };

 It will get converted into HTTP parameters foo=bar and boo=far.

 In your example, you have one key, Request, and its value is an object.
 Converting the value (a JavaScript object) to a string yields [object
 Object], which is what you're seeing. If you were expecting to get complex
 PHP objects on your server side, you're mistaken about how HTTP parameters
 work :)

 Basically, make your JSON object only one level deep and you should be fine.

 Hope it helps.

 --Erik

 On 7/15/08, jlb [EMAIL PROTECTED] wrote:



  According to the jQuery docs, the data option (in $.ajax) is supposed
  to accept a string or an object (which it then converts to a query
  string).  It appears as though its not converting my object:

  My Javascript is:

          var json = {
            Request : {
                action     : doSomething,
                params   : {id:123}
            }
         };

          $.ajax({
              type: POST,
              url: WEB_DOMAIN + /api.php,
              data: json
          });

  In api.php contains:

    ?php var_dump($_REQUEST['Request']); ?

  Which outputs:

  string(15) [object Object]

  Does anyone know what I'm doing wrong?


[jQuery] Re: [autocomplete]

2008-07-16 Thread fredriley

[apologies if this reply appears twice - my session had ended when I
hit post the first time so I wasn't sure if I'd made it as it didn't
appear on a page refresh.]

On Jul 15, 9:36 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Check out the demo (http://jquery.bassistance.de/autocomplete/demo/),
 pick the example that comes closest to your requirement, and take a
 look at the code for that one. Firebug helps a lot there.

Thanks for the reply, Jörn, and sorry I forgot to put a more
meaningful subject on my post.

 From what you describe, the single bird (remote) comes quite close.

It does, and I did look at that demo page, but after scrolling through
the long source code I got lost finding what called what, how, when,
and with what syntax and data type. I'll do it again, but this time
use Firebug as you advise.

 This is the code for it:

 $(#singleBirdRemote).autocomplete(search.php, {
 width: 260,
 selectFirst: false
 });
 $(#singleBirdRemote).result(function(event, data, formatted) {
 if (data)
 $(this).parent().next().find(input).val(data[1]);
 });

 The resource search.php gets a paramter q with the entered term and
 returns a list of terms, columns separated with a pipe, rows with
 newline (again, Firebug helps, just look at the request/response).

Ok, thanks, I'd never have figured that out myself.

 In general I can recommend to learn some jQuery basics, that will get
 you a long way.

I've spent a few hours on jQuery (and on stacks of other Ajax
frameworks ;-|) and thought I knew the basics, but plainly the basics
I learnt were too basic to really understand the basics, so I'll try
to put aside a couple of days to properly understand it.

rant
I've got to say that, at times with jQuery, MooTools, prototype,
Sajax, ext.js, and the rest, I thought that it would be quicker to
write the code from scratch in Javascript... Time, that's the problem
- I just never get enough of it at work, yet users are forever saying
why can't you implement that thing I saw on Google/Amazon/YouTube?
expecting that it's wash 'n' go, a matter of moments to do. When I
tell them that I've got to put days aside to learn a new library/
framework in order to implement what they see as easy eye candy they
look at me as if to say what kind of techie are you? ;-\
/rant

For all that, I do appreciate the serious work the jQuery developers
put in to the framework, and big kudos for doing so :)

Cheers

Fred


[jQuery] Re: [autocomplete]

2008-07-16 Thread fredriley

On Jul 15, 9:36 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Check out the demo (http://jquery.bassistance.de/autocomplete/demo/),
 pick the example that comes closest to your requirement, and take a
 look at the code for that one. Firebug helps a lot there.

Thanks for the reply, Jörn, and sorry I forgot to put a more
meaningful subject on my post.

 From what you describe, the single bird (remote) comes quite close.

It does, and I did look at that demo page, but after scrolling through
the long source code I got lost finding what called what, how, when,
and with what syntax and data type. I'll do it again, but this time
use Firebug as you advise.

 This is the code for it:

 $(#singleBirdRemote).autocomplete(search.php, {
 width: 260,
 selectFirst: false
 });
 $(#singleBirdRemote).result(function(event, data, formatted) {
 if (data)
 $(this).parent().next().find(input).val(data[1]);
 });

 The resource search.php gets a paramter q with the entered term and
 returns a list of terms, columns separated with a pipe, rows with
 newline (again, Firebug helps, just look at the request/response).

Ok, thanks, I'd never have figured that out myself.

 In general I can recommend to learn some jQuery basics, that will get
 you a long way.

I've spent a few hours on jQuery (and on stacks of other Ajax
frameworks ;-|) and thought I knew the basics, but plainly the basics
I learnt were too basic to really understand the basics, so I'll try
to put aside a couple of days to properly understand it.

rant
I've got to say that, at times with jQuery, MooTools, prototype,
Sajax, ext.js, and the rest, I thought that it would be quicker to
write the code from scratch in Javascript... Time, that's the problem
- I just never get enough of it at work, yet users are forever saying
why can't you implement that thing I saw on Google/Amazon/YouTube?
expecting that it's wash 'n' go, a matter of moments to do. When I
tell them that I've got to put days aside to learn a new library/
framework in order to implement what they see as easy eye candy they
look at me as if to say what kind of techie are you? ;-\
/rant

For all that, I do appreciate the serious work the jQuery developers
put in to the framework, and big kudos for doing so :)

Cheers

Fred


[jQuery] Re: Underlay to replace overlay

2008-07-16 Thread JohnieKarr

Gabriel,

Since that's the case here is the method I would use.

div with no background onload that contains the gallery of thumbs.
next, when you click a thumb the loading gif becomes background while
the selected image is loading.  once loaded it becomes the background.

I'm not sure how to do the loading image, but I'm sure there are
plenty of plugins available for this.

Have a good day!
Johnie Karr

On Jul 15, 4:28 pm, Gabriel [EMAIL PROTECTED] wrote:
 Hi Johnie,

 Yes, this is what I want to do... But I want to keep the little image
 that indicates there is something loading and more, I want to have my
 thumb in front of the image displayed.
 That's it !

 Thank you for answering.

 Gabriel

 On 14 juil, 15:09, JohnieKarr [EMAIL PROTECTED] wrote:



  Hi Gabriel,

  I'm not familiar with thickbox, but don't you just want your gallery
  to be a div and change the background image of that div?

  I hope I'm visualizing what you want correctly.

  Thanks,
  Johnie Karr

  On Jul 12, 7:22 am, Gabriel [EMAIL PROTECTED] wrote:

   Nobody ??? :(

   On 10 juil, 23:13, Gabriel [EMAIL PROTECTED] wrote:

Hi everybody,

I was wondering how I can modify Thickbox plugin so that the images do
not show up over the gallery (thumb - images) but under the gallery. I
call it anunderlay.
Thank you very much,

Gabriel- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Cycle Plugin - multiple instances on same page?

2008-07-16 Thread wdm

On Jul 16, 2:29 pm, Mike Alsup [EMAIL PROTECTED] wrote:
 On Jul 15, 4:22 pm, wdm [EMAIL PROTECTED] wrote:



  Any way to have several slideshows on the same page, each with their
  own independent navigation (prev/next), without giving them unique
  ids?

  Couldn't get this working:

  $('.gallery').each(function() {

          var p = this.parentNode;

          $(this).cycle({
                  fx:             'scrollHorz',
                  speed:  'slow',
                  timeout: 0,
                  next:   $('a.next-image', p)
          });

  });

 That looks like it should work, assuming you have an anchor with a
 next-image class within the gallery parent.  Can you post a link?


My mistake -- the next-image link wasn't within the gallery parent.

Could you explain how the next: $('a.next-image', p) part works -- is
the 'p' a second argument? I couldn't find this documented in the
cycle plugin docs.

Thanks


[jQuery] Need help with animations in IE

2008-07-16 Thread The Sixth Halcon

Hi, this is one of my firsts experiences with jQuery and I have a
little problems already.
The problem explanation is that I want to apply an effect to a css
layer (and it is applied) that when you click on a special div, it
moves some layers. It works perfectly with Firefox, but not in IE...
I leave here the css code and the jQuery script...

//  jQuery
script type=text/javascript
  $(document).ready(function(){
var selected_opt = 0;
var speed= 300;

$(#contentbox4).animate({
  opacity: 0
});


$(#footer_lt).click(function () {
  $(#contentbox1).animate({
opacity: 0,
left: -500px
  }, speed );
  $(#contentbox2).animate({
left: 0px
  }, speed );
  $(#contentbox3).animate({
left: 311px,
  }, speed );
  $(#contentbox4).animate({
opacity: 100,
right: 0px
  }, speed );

  selected_opt = 1;
});


$(#footer_rt).click(function () {
  $(#contentbox1).animate({
opacity: 100,
left: 0px
  }, speed );
  $(#contentbox2).animate({
left: 311px
  }, speed );
  $(#contentbox3).animate({
left: 622px
  }, speed );
  $(#contentbox4).animate({
opacity: 0,
right: -500px
  }, speed );
});

  });
/script

//  CSS
#contentbox1 {
position:absolute;
left:0px;
top:80px;
width:278px;
height:439px;
}

#contentbox2 {
position:absolute;
left: 311px; /* 336px; = Para el master950px */
top:80px;
width:278px;
height:439px;
}

#contentbox3 {
position:absolute;
right:0px;
top:80px;
width:278px;
height:439px;
}

#contentbox4 {
position:absolute;
right:-500px;
top:80px;
width:278px;
height:439px;
}



You dont have to rewrite the code if you don't want (I don't want to
annoy anyone) but if you can explain me the error... ^^

Thanks anyway!


[jQuery] Google analytics exception

2008-07-16 Thread [EMAIL PROTECTED]

I'm aware this is a common error, but has anybody found a solution
yet?

The error with ga.js is as follows:
Error: uncaught exception: [Exception... Component returned failure
code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMScreen.width]  nsresult:
0x80004005 (NS_ERROR_FAILURE)  location: JS frame ::
http://www.google-analytics.com/ga.js :: anonymous :: line 15  data:
no]

It seems to be preventing my scrolling div from scrolling - and is
probably screwing up the analytics results, too!

I understand it's happening because I'm using iframes on the page at
http://buttermarketfriends.co.uk/ . One of the included pages also
carries the Google script.

I'd appreciate any advice that doesn't involve removing the analytics
code ;)

Cheers,
Cherry.


[jQuery] Jcaroussel with more than one li wide

2008-07-16 Thread Jo

Hello

I want to use the http://sorgalla.com/jcarousel/, but with more than
one column of thumbnails.

For example, with the vertical carousel (http://sorgalla.com/projects/
jcarousel/examples/static_vertical.html), set :

.jcarousel-skin-tango .jcarousel-clip-vertical {
height:245px;
width:200px; // instead of 75px
}

 200px is wider than the thumbnails, and provide a two columns
vertical carousel.

But if I scroll down, it scroll 2 times more than needed...

Is it a solution ?



[jQuery] Re: [autocomplete]

2008-07-16 Thread fredriley

Thanks a lot, Jörn. I did try twice to post a detailed reply to your
reply, but nothing's appeared here so it looks like it's fallen into a
cyber black hole. No bother. Incorporating your very useful help I've
managed to create a revised and working test at:

http://www.nottingham.ac.uk/~ntzfr/test/ajax/jquery/jquery_test1.html

Looks like I need to put a day or two aside to really, really get
under the skin of jQuery...

Cheers

Fred


[jQuery] Re: mixing validate, and ajaxSubmit

2008-07-16 Thread Andiih

Fantastic - I'd guessed my way into getting it working (using
submitHandler with no arguments) but hadn't realized that
submitHandler can pass the form.  I can make the handler much more
generic.  Thanks for that.

What are the default classes that cause validation ?

Andrew

On Jul 16, 2:13 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Put the ajaxSubmit stuff into the submitHandler-callback, here is an
 example:http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-de...

 Jörn



 On Wed, Jul 16, 2008 at 11:29 AM, Andiih [EMAIL PROTECTED] wrote:

  The behaviour I have is that the form is correctly validated, but
  submits

                 $('#editjobsform').submit(function()  {dosavejob();   return
  false; });
  //other stuff here
                 $('#editjobsform').validate(
                         { rules: {blah:blah   },
                           messages: {   blah: blah} }
                         );
  //other stuff here
         function dosavejob() {
                 $('#editjobsform').ajaxSubmit({  // editjobsform 
  action=/srv/
  coms2.asmx/getJobs
                                 beforeSubmit: ShowBusy,
                                 success: DoneSaveJob,
                                 dataType: 'xml',
                                 error: function(XMLHttpRequest, textStatus, 
  errorThrown)
  {NotFound(); ClearBusy();}
                                 });
                 return false;
                 }

  I've tried changing the order of the .submit and .ajaxSubmit but to no
  avail.  Chaining them loses the .ajaxSubmit behaviour and I ended up
  looking the xml returned by my web service.

  The documentation mentions submitHandler which might do the trick, but
  isn't docuemented in the API documentation section.

  Speaking of which, there appear to be some classes which cause
  validation to occur ('required' 'url' 'date') but again these are not
  documented: or am I missing something ? [other than reading the source
  code]

  TIA

  Andrew- Hide quoted text -

 - Show quoted text -


[jQuery] Re: show hidden div on click

2008-07-16 Thread neuron

Thanks for the help everyone- it works! :) Now, some tweaking... I
have several divisions that I want to show in this manner, so how do I
make the code a general rule as opposed to a specific order to show
#overview? For example, how would I show #contact without writing a
new script snippet? I would like to use the same class (fadein).

--
As an update, here is my relevant (and working!) code:


Script in head:

script type=text/javascript
  $(document).ready(function(){
$('.fadein').click(function(){
  $('#overview').show('slow');
  return false;
});
  });
/script


CSS:

div#overview {
  display: none;
}


HTML in body:

a class=fadeinOverview/a
div id=overviewpthis is the overview text/p/div


[jQuery] using scrollTo to keep dynamically added content scrolled into view?

2008-07-16 Thread rolfsf

If one has a textarea or editable div with overflow: auto, and one
starts typing and filling the div, due to focus on the cursor the
scroll will keep the newly added lines in view. But if one is adding
the content dynamically, the newly added lines will appear out of view
- there's no cursor to focus on.

Question - can the scrollTo plugin be used to automatically keep the
last line of text in view? Is there a simple way to do this?

Thanks!


[jQuery] Re: Multiple Instances of the same effect without unique IDs

2008-07-16 Thread Joe S

I've just tried this and it seems to work... just wondering what other
unintended side effects I'm not seeing   ;)

$(.extraContent).hide();  // hide the extra stuff by default

$('a.extraContentTrigger').click(function() { // added a class to
the [TITLE] link
  $(this.parentNode).find('.extraContent').slideToggle();
});



On Jul 16, 12:09 pm, Joe S [EMAIL PROTECTED] wrote:
 OK, spoke too soon... on further testing, I'm getting an unintended
 (but really stupid, on my part) side effect...

 if i put another anchor in the hidden content (a link to a file or
 site, for example), the toggle is triggered on that click, too (since
 it's in the wrapper DIV, right?). so, in a single table cell, i've
 got:

 div class=contentWrapper
    a href=#[TITLE of CONTENT]/a
       div class=extraContent
          a href=foo.comMy File/a
          a href=bar.comAnother Site/a
       /div
 /div

 I need to click the title  expose the extraContent  and click the
 links in the extraContent without triggering the toggle. is there way
 to either adjust what i'm listening for (the click of the [Title]) or
 ignore clicks within the extraContent (again, without resorting to
 unique IDs for each row)?

 --joe

 On Jul 16, 8:59 am, Joe S [EMAIL PROTECTED] wrote:

  Hi Karl,
  Thanks so much for the help - it definitely got me in the right
  direction. Here's what I ended up with inside the (document).ready
  function:

  $(.extraContent).hide();  // hide the extra stuff by default

  $('div.contentWrapper').click(function() {     // contentWrapper DIV,
  contains a[TITLE]/a and .extraContent DIV
    $(this).find('.extraContent').slideToggle();  // slide toggles
  the .extraContent DIV within the .contentWrapper

  });

  it all seems to work; clicking one leaves the others untouched;
  clicking multiple works as it should. i was getting weird thing
  happening with the 'td:first-child' approach. is anything i'm doing
  terribly bad form?

  again, thanks!

  On Jul 15, 7:51 pm, Karl Swedberg [EMAIL PROTECTED] wrote:

   Hi Joe,

   Assuming that the additional information that you're initially hiding  
   is in a span tag, I'd do something like this:

   $(document).ready(function() {
      $('td:first-child').click(function() {
        $(this).find('span').slideToggle();
      });

   });

   --Karl
   
   Karl Swedbergwww.englishrules.comwww.learningjquery.com

   On Jul 15, 2008, at 2:04 PM, Joe S wrote:

I know this has got to be in here somewhere; I'm not familiar enough
with jQuery syntax to know what a valid search string is (i keep
looking for EACH and THIS and MULTIPLE but I'm not returning anything
useful). So I apologize that my noob stripes are showing through...

I've got (basically) a table looking like:

Title          |  Release Date  |   Revised Date | Contact
---
---
Apples       |    08-2005     |    09-2006     | John Smith
---
Bananas    |    08-2005     |    09-2006     | John Smith
---
Oranges     |    08-2005     |    09-2006     | John Smith

I'm trying to add the ability to toggleSlide a (initially) hidden div
under each individual [TITLE] without triggering the rest of the
hidden content *AND -- if possible* without assigning a unique ID to
each title/content pair (I could make it work that way, but these
update a lot, and keeping track of the last unique value is a chore).

For example, clicking on Apples would reveal:

Title           |  Release Date  |   Revised Date | Contact
---
---
Apples        |    08-2005        |    09-2006       | John Smith
Apples are  |
Tasty.         |
---
Bananas     |    08-2005     |    09-2006     | John Smith
---
Oranges     |    08-2005     |    09-2006     | John Smith

SO... I need some way of saying:

[click a title  reveal the corresponding content  click it again to
hide it] leaving the rest of the table in tact

Sound doable, or should I just go the unique ID route? Thanks in
advance!


[jQuery] Re: Uncompressed, Minified and Gzipped and Packed

2008-07-16 Thread Andy Matthews

Thanks for clarifying Mika...please note Mika's comments. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mika Tuupola
Sent: Wednesday, July 16, 2008 11:59 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Uncompressed, Minified and Gzipped and Packed



On Jul 16, 2008, at 7:48 PM, Andy Matthews wrote:

 Packed takes the source code and runs it through an algorithmn which 
 compresses variable names, methods, code, etc into one big line of 
 javascript. You can find more information about it, and pack your own 
 code,
 here:
 http://dean.edwards.name/packer/

 Minified uses server side compression to further reduce the file size.
 Drawback of this method is that your server needs to be equipped to 
 offer this version, and the file needs to be de-compressed on the 
 client side.

Minifying does not use server side compression. Minifying means removing all
unnecessary characters from source code, without changing its functionality.

Minified JavaScript files are usually further packed by gzipping them.  
This is done on the fly by server. Apache comes with mod_deflate module by
default. This handles gzipping.

Packed files have to be uncompressed on client side too. While gzipped files
are uncompressed by browser natively, packed files are uncompressed
calling JavaScript eval() everytime page loads.

--
Mika Tuupola
http://www.appelsiini.net/




[jQuery] Re: Cycle Plugin - multiple instances on same page?

2008-07-16 Thread Mike Alsup

   Any way to have several slideshows on the same page, each with their
   own independent navigation (prev/next), without giving them unique
   ids?

   Couldn't get this working:

   $('.gallery').each(function() {

           var p = this.parentNode;

           $(this).cycle({
                   fx:             'scrollHorz',
                   speed:  'slow',
                   timeout: 0,
                   next:   $('a.next-image', p)
           });

   });

  That looks like it should work, assuming you have an anchor with a
  next-image class within the gallery parent.  Can you post a link?

 My mistake -- the next-image link wasn't within the gallery parent.

 Could you explain how the next: $('a.next-image', p) part works -- is
 the 'p' a second argument? I couldn't find this documented in the
 cycle plugin docs.


$('a.next-image', p)

The above is just a jQuery expression.  You could have just as easily
written your script like this:

$('.gallery').each(function() {
var next_link = $('a.next-image', this.parentNode);
$(this).cycle({
fx: 'scrollHorz',
speed:  'slow',
timeout: 0,
next:next_link
});
});


[jQuery] Re: Need help with animations in IE

2008-07-16 Thread spicyj

It always helps if you can upload a simple test case page that
displays the error.


[jQuery] Re: Insert new DOM element with new ID (index)?

2008-07-16 Thread spicyj

I think your code has a couple extra lines. It should be:

$('.new').livequery('click', function() {
  $('.new').before('li class=item' + (index+2) + 'Item ' + (index
+ 2) + '/li');
  return false;
});

Though I'm not sure you actually need livequery there; I think bind
would suffice.


[jQuery] Re: yet again XML+jQuery+IE7

2008-07-16 Thread koko

Yeah it's a kind of bug in jQuery ...

I dealt with this issue one month ago and the solution was to convert
it into JSON


[jQuery] Re: mixing validate, and ajaxSubmit

2008-07-16 Thread Jörn Zaefferer

All available validation methods are listed here:
http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation_methods

Jörn

On Wed, Jul 16, 2008 at 6:47 PM, Andiih [EMAIL PROTECTED] wrote:

 Fantastic - I'd guessed my way into getting it working (using
 submitHandler with no arguments) but hadn't realized that
 submitHandler can pass the form.  I can make the handler much more
 generic.  Thanks for that.

 What are the default classes that cause validation ?

 Andrew

 On Jul 16, 2:13 pm, Jörn Zaefferer [EMAIL PROTECTED]
 wrote:
 Put the ajaxSubmit stuff into the submitHandler-callback, here is an
 example:http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-de...

 Jörn



 On Wed, Jul 16, 2008 at 11:29 AM, Andiih [EMAIL PROTECTED] wrote:

  The behaviour I have is that the form is correctly validated, but
  submits

 $('#editjobsform').submit(function()  {dosavejob();   return
  false; });
  //other stuff here
 $('#editjobsform').validate(
 { rules: {blah:blah   },
   messages: {   blah: blah} }
 );
  //other stuff here
 function dosavejob() {
 $('#editjobsform').ajaxSubmit({  // editjobsform 
  action=/srv/
  coms2.asmx/getJobs
 beforeSubmit: ShowBusy,
 success: DoneSaveJob,
 dataType: 'xml',
 error: function(XMLHttpRequest, textStatus, 
  errorThrown)
  {NotFound(); ClearBusy();}
 });
 return false;
 }

  I've tried changing the order of the .submit and .ajaxSubmit but to no
  avail.  Chaining them loses the .ajaxSubmit behaviour and I ended up
  looking the xml returned by my web service.

  The documentation mentions submitHandler which might do the trick, but
  isn't docuemented in the API documentation section.

  Speaking of which, there appear to be some classes which cause
  validation to occur ('required' 'url' 'date') but again these are not
  documented: or am I missing something ? [other than reading the source
  code]

  TIA

  Andrew- Hide quoted text -

 - Show quoted text -



[jQuery] Re: [autocomplete]

2008-07-16 Thread Jörn Zaefferer

Or get a copy of Learning jQuery and read half an hour in the morning
or evening.

Jörn

On Wed, Jul 16, 2008 at 5:38 PM, fredriley [EMAIL PROTECTED] wrote:

 Thanks a lot, Jörn. I did try twice to post a detailed reply to your
 reply, but nothing's appeared here so it looks like it's fallen into a
 cyber black hole. No bother. Incorporating your very useful help I've
 managed to create a revised and working test at:

 http://www.nottingham.ac.uk/~ntzfr/test/ajax/jquery/jquery_test1.html

 Looks like I need to put a day or two aside to really, really get
 under the skin of jQuery...

 Cheers

 Fred



[jQuery] Livequery add class to new DOM elements

2008-07-16 Thread hubbs

I am trying to get live query to work, so that it will add a new class
to links that have just been added to the DOM through ajax.

Something is not right though:

$('a.calendarNavLink').livequery(function(){
$(this).addClass('ajax');
});

Have I done something wrong here?


[jQuery] animate problem

2008-07-16 Thread rayfidelity

Hi,

I'm currently using:

$(#msg).empty().prepend('div class=successIt works!/
div').show(slow).animate({opacity: 1.0}, 5000).fadeOut(slow);

But the problem is, that it's still showing (for the specified 5000ms)
after i invoke new action which should display something different
than It works! instead waiting for 5000ms and then showing new msg.

How can i stop the previous animate to make place for the new msg?

Thanks,
BR


[jQuery] Re: Need help with animations in IE

2008-07-16 Thread The Sixth Halcon

Here you can see a functional sample ;)
http://blitrank.com/pspsdk_test/

Thanks a lot!


[jQuery] Help with XML parsing/looping

2008-07-16 Thread linesandwaves

Hi all,

I realize this is a gigantic newbie question, but I am totally stuck
and I want to do this the right way... figured I'd go to the experts.

I'm trying to write a section of code in jquery that will read my XML
sheet and then produce a set of unordered lists with individual list
items in HTML.  I have it working, but the problem is that my code is
finding every single instance of certain tags and then adding them to
my lists.  So ultimately, every list that this code generates is
perfectly formatted, but they all have the same information.. which is
a problem.

Here is my XML sheet:

?xml version=1.0 encoding=UTF-8 standalone=yes?
breakfast
dishset
setnameThe Royal Breakfast/setname
entreelisting
entreenameEggs and whatever/entreename
price$15.00/price
/entreelisting
entreelisting
entreenameA waffle with sprinkles on it/entreename
price$15.00/price
/entreelisting
entreelisting
entreenameSyrup-covered bacon bits/entreename
price$15.00/price
/entreelisting
/dishset
dishset
setnameThe Gravy Train/setname
entreelisting
entreenameGravy Boats/entreename
price$15.00/price
/entreelisting
entreelisting
entreenameMush Plate/entreename
price$15.00/price
/entreelisting
entreelisting
entreename type=dishadditionDeep Fried 
Anything/entreename
price$15.00/price
/entreelisting
/dishset
/breakfast


And here is my jquery code:

// Start function when DOM has completely loaded
$(document).ready(function(){

// Open the breakfast.xml file
$.get(breakfast.xml,{},function(xml){

// Build an HTML string
myHTMLOutput = '';

// Run the function for each dishset tag in the XML file
$('dishset',xml).each(function(j){
myHTMLOutput += 'ul class=dishsection';
setName = $(this).find(setname).text();
if ((setName) != undefined){
myHTMLOutput += 'h3'+ setName +'/h3';
}

// Run the function for each entreelisting tag in the XML file
$('entreelisting',xml).each(function(i) {
entreeName = $(this).find(entreename).text();
price = $(this).find(price).text();
dishAdditions = $(this).find(entreename).attr(type);
// Build row HTML data and store in string
mydata = BuildMenuHTML(entreeName,price,dishAdditions);
myHTMLOutput = myHTMLOutput + mydata;
});  //run entreelist
myHTMLOutput += '/ul';
}); //run dishset function
$(#menucontent).append(myHTMLOutput);
}); //get xml file
});  //document.ready function



 function BuildMenuHTML(entreeName,price,dishAdditions){

// Check to see if their is a post attribute in the name field
if ((dishAdditions) != undefined){
dishAdditionsHTML = 'span class=entreename'+ dishAdditions 
+'/
em';
entreeNameHTML = '';
liClassHTML = 'li class=dishsubentry';
}
else
{
entreeNameHTML = 'span class=entreename'+ entreeName 
+'/span';
dishAdditionsHTML = '';
liClassHTML = 'li class=dishentry';
}

// Build HTML string and return
output = '';
output += liClassHTML;
output += entreeNameHTML;
output += dishAdditionsHTML;
output += 'span class=price'+ price +'/span';
output += '/li';
return output;
}


I know that this is probably an obvious or easy fix related to calling
each() in the entreelisting function, but I just don't know what
the proper ways to reference certain things are.  Any chance anyone
out there could help??

Thanks!



[jQuery] Re: Livequery add class to new DOM elements

2008-07-16 Thread noon

livequery accepts two parameters, the first is the event to which a
function (the 2nd parameter) is bound to.

$('a.someLink').livequery('click', function() {
  // anchors with a class of 'someLink'
  // can now be dynamically inserted to the dom
  // yet still have an 'onclick' event associated with them
  // as compared to the event only being bound on document ready
});

On Jul 16, 2:05 pm, hubbs [EMAIL PROTECTED] wrote:
 I am trying to get live query to work, so that it will add a new class
 to links that have just been added to the DOM through ajax.

 Something is not right though:

 $('a.calendarNavLink').livequery(function(){
         $(this).addClass('ajax');
             });

 Have I done something wrong here?


[jQuery] Re: Livequery add class to new DOM elements

2008-07-16 Thread noon

sorry, I am incorrect.  I forgot there were multiple forms.  That
should work

On Jul 16, 2:29 pm, noon [EMAIL PROTECTED] wrote:
 livequery accepts two parameters, the first is the event to which a
 function (the 2nd parameter) is bound to.

 $('a.someLink').livequery('click', function() {
   // anchors with a class of 'someLink'
   // can now be dynamically inserted to the dom
   // yet still have an 'onclick' event associated with them
   // as compared to the event only being bound on document ready

 });

 On Jul 16, 2:05 pm, hubbs [EMAIL PROTECTED] wrote:

  I am trying to get live query to work, so that it will add a new class
  to links that have just been added to the DOM through ajax.

  Something is not right though:

  $('a.calendarNavLink').livequery(function(){
          $(this).addClass('ajax');
              });

  Have I done something wrong here?


[jQuery] Re: Need help with animations in IE

2008-07-16 Thread spicyj

On line 27, 'left: 311px' should not have a comma after it. That
solves the problem for me.

On Jul 16, 11:54 am, The Sixth Halcon [EMAIL PROTECTED] wrote:
 Here you can see a functional sample ;)http://blitrank.com/pspsdk_test/

 Thanks a lot!


[jQuery] Re: yet again XML+jQuery+IE7

2008-07-16 Thread Tzury

 Yeah it's a kind of bug in jQuery ...

 I dealt with this issue one month ago and the solution was to convert
 it into JSON

the way I am planning to approach is by building in-memory DOM element
and injecting the XML into it.

example:
var el = document.createElement('div');
el.innerHTML = xml;
alert(el.firstChild.innerHTML);

utilizing jQuery facilities for DOM traversing is the next obvious
step.

hope someone will notice this and file a bug for the dears jQuery
developers.


[jQuery] AutoComplete Multiple Elements, Same Function

2008-07-16 Thread shapper

Hello,

I have 3 inputs that use the same AutoComplete function. Can I make
this work only with one command?
I have:

  $(#Tags).autocomplete(GetTags, {
autoFill: true ...

I tried

  $(#Tags, #MoreTags).autocomplete(GetTags, {
autoFill: true ...

But it does not work. How can I do this?

Thanks,
Miguel


[jQuery] Sortables Organize

2008-07-16 Thread armsteadj1

If i have 3 columns that hold 3 divs (div class=feed/div) each
and i make those columns sortable by:

$('.column').sortable();

Now if someone moved one of the divs to another column, then that
column would recieve 4 divs.. is there anyway to make it so the
sortables would be evened out? so if one column has 4 divs and another
one has 2 the very bottom div would move down to fill in that spot at
the bottom?

Example: http://www.myiowa-news.com/test/jquery/sort.html

Would the easiest way to do this be by including in the stop callback
to count each row and if one row has 2 more than another row then move
the bottom one over? Thank you!

James


[jQuery] Re: Help with XML parsing/looping

2008-07-16 Thread spicyj

Change $('entreelisting',xml) to $('entreelisting',this).


[jQuery] Re: AutoComplete Multiple Elements, Same Function

2008-07-16 Thread spicyj

Try:

$(#Tags, #MoreTags).each(function(input) {
  input.autocomplete(GetTags, {
autoFill: true
  });
});



[jQuery] jQuery.ajax / xml / callbacks

2008-07-16 Thread twocoasttb


Neither of the callbacks in the following code are ever invoked:

  jQuery.ajax({
type: GET,
url: actionUrl,
data: { productId: productId, quantity: quantity },
dataType: xml,
error: function(e) { alert(Failure:  + e); },
success: function(xml) { alert(Got Results:  + xml); } });

I have verified the following:

1. The url defined by 'actionUrl' is being called correctly (determined from
server logs)
2. The results appear to be valid (at least when I invoke the url manually);
the content type is text/xml.

What am I doing wrong here???
-- 
View this message in context: 
http://www.nabble.com/jQuery.ajax---xml---callbacks-tp18495672s27240p18495672.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: AutoComplete Multiple Elements, Same Function

2008-07-16 Thread Jörn Zaefferer

Or rather:

$(#Tags, #MoreTags).each(function() {
 $(this).autocomplete(GetTags, {
   autoFill: true
 });
});

On Wed, Jul 16, 2008 at 10:09 PM, spicyj [EMAIL PROTECTED] wrote:

 Try:

 $(#Tags, #MoreTags).each(function(input) {
  input.autocomplete(GetTags, {
autoFill: true
  });
 });




[jQuery] Re: Livequery add class to new DOM elements

2008-07-16 Thread hubbs

Ok, I realize it is working.  But, for some reason it is not working
with the ajaxload script.  I have a feeling I have to somehow call the
ajaxload from within livequery.

$('a.ajax').ajaxContent({
target:'#adminToolsListing',
event:'click',
loaderType:'img',
loadingMsg:'/__data/assets/image/0018/24345/announce-
loading.gif'
});
});

Any ideas on how to make the two work together?

On Jul 16, 11:34 am, noon [EMAIL PROTECTED] wrote:
 sorry, I am incorrect.  I forgot there were multiple forms.  That
 should work

 On Jul 16, 2:29 pm, noon [EMAIL PROTECTED] wrote:

  livequery accepts two parameters, the first is the event to which a
  function (the 2nd parameter) is bound to.

  $('a.someLink').livequery('click', function() {
    // anchors with a class of 'someLink'
    // can now be dynamically inserted to the dom
    // yet still have an 'onclick' event associated with them
    // as compared to the event only being bound on document ready

  });

  On Jul 16, 2:05 pm, hubbs [EMAIL PROTECTED] wrote:

   I am trying to get live query to work, so that it will add a new class
   to links that have just been added to the DOM through ajax.

   Something is not right though:

   $('a.calendarNavLink').livequery(function(){
           $(this).addClass('ajax');
               });

   Have I done something wrong here?


[jQuery] Re: Need help with animations in IE

2008-07-16 Thread The Sixth Halcon

Wow, thanks, I revised the code but I didn't see it...
So... it works!!

Thanks a lot for your time... and... see you!


[jQuery] Re: Sortables Organize

2008-07-16 Thread armsteadj1

Alright, I fixed that problem by taking out the columns and just
changin some css.. now i just need to figure out how to make it so the
large gaps don't get created when a div is bigger or smaller than the
normal size..

On Jul 16, 2:32 pm, armsteadj1 [EMAIL PROTECTED] wrote:
 If i have 3 columns that hold 3 divs (div class=feed/div) each
 and i make those columns sortable by:

 $('.column').sortable();

 Now if someone moved one of the divs to another column, then that
 column would recieve 4 divs.. is there anyway to make it so the
 sortables would be evened out? so if one column has 4 divs and another
 one has 2 the very bottom div would move down to fill in that spot at
 the bottom?

 Example:http://www.myiowa-news.com/test/jquery/sort.html

 Would the easiest way to do this be by including in the stop callback
 to count each row and if one row has 2 more than another row then move
 the bottom one over? Thank you!

 James


[jQuery] addClass or toggleClass?

2008-07-16 Thread lukas

The CASE:
I have 3 links which specify 3 different views (or various sized
DIVs).
If the user clicks a specific view the according link should become
invisible. As a result only 2 links supposed to be active and visible
at any time since the 3rd view is currently active.
What is the most elegant way to accomplish this?

Might it be better to display all three links and make one link
inactive by removing the a element and give it a grey color? Is this
possible?

Thanks for your help!


[jQuery] Display input field when option is selected

2008-07-16 Thread emeade

I have a form with a table that contains a list of names. For each
name there are two drop downs - relationship1 and relationship2. When
the user selects the option, Other Relative or Other household member,
I need a text input to display allowing them to enter the actual
relationship.

I have something that partially works but I will be using this in
several places so I would like to make the code more reusable by
allowing parameters to be sent in for the select field name and the
input field name. Maybe it needs to be a plugin.

I'm a real n00b with jquery so any help is appreciated.

Here's my script. My first thought was that I could at least pass the
name of the otherDiv to the onSelectChange function but I'm not sure
what the syntax is given the way I'm calling it.

script
jQuery(document).ready(function(){

//show:hide relationship other fields on initial page load
$(select[name='relationship1']).each(onSelectChange);

//show:hide relationship other fields on select change
$(select[name='relationship1']).change(onSelectChange);
});

function onSelectChange(){
var selectedText = this.value != 0 ? $
(this).find(:selected).text() : '' ;
var isOther = false;
if(selectedText.indexOf(Other relative) == 0 ||
selectedText.indexOf(Other household member) == 0){
isOther = true;
}
var selectedRow = $(this).attr(currow);
var otherDiv = $(#OtherSection1_ + selectedRow)[isOther ? show :
hide](fast);
var otherDivInputs = otherDiv.find(input)[isOther ? addClass :
removeClass](required);
}
/script

Here is a sample of the HTML:
table id=tablesorter-youth class=tablesorter border=0
cellpadding=0 cellspacing=0
thead
tr
th class=header headerSortUpID/th
th class=headerName/th
th class=headerPrimary Caregiver/th
th class=headerCaregiver 2/th
/tr
/thead
tbody
tr
td11/td
tdDoe, John/td
td class=nowrap
select name=relationship1 
id=relationship1_1
class=datainput currow=1 style=width:170px
option 
value=--SELECT--/option
option 
value=11|1|1Biological Mother/
option
option 
value=11|2|1Biological Father/
option
option 
value=11|3|1Stepparent/option
option 
value=11|4|1Grandparent/option
option 
value=11|5|1Adoptive Parent/option
option 
value=11|6|1Foster Parent/option
option 
value=11|7|1Other relative /option
option 
value=11|8|1Other household member /
option
/select
div id=OtherSection1_1 
name=OtherSection1
style=display:none class=otherinput
input type=text 
name=OtherText1_1 id=OtherText1_1
value= class=datainput otherfield
/div
/td
td class=nowrap
select name=relationship2 
id=relationship2_1
class=datainput currow=1 style=width:170px
option 
value=--SELECT--/option
option 
value=11|1|1Biological Mother/option
option 
value=11|2|1Biological Father/option
option 
value=11|3|1Stepparent/option
option 
value=11|4|1Grandparent/option
option 
value=11|5|1Adoptive Parent/option
option 
value=11|6|1Foster Parent/option
option 
value=11|7|1Other relative /option
option 
value=11|8|1Other household member /option
/select
div id=OtherSection2_1 
name=OtherSection2
style=display:none class=otherinput
input type=text 
name=OtherText2_1 id=OtherText2_1
value= maxlength=70 class=datainput otherfield style=width:
150px
/div
/td

[jQuery] jcarousel explodes

2008-07-16 Thread mconnors

I can't seem to use jcarousel if it I use the start option to be more
than 1,000. I am using it for a photo site where the slide image could
anywhere from 1 to 300,000

e.g.

jQuery('#photo_carousel').jcarousel(
{
scroll: 1,
start:1400,
size: 23000,
itemLoadCallback: mycarousel_itemLoadCallback

}
);

Use this and it goes BOOM!


[jQuery] [ANNOUNCE] Twitter Accounts for jQuery jQuery UI Projects

2008-07-16 Thread Rey Bango


One of the things that the team tries hard to do is provide as much 
information to jQuery developers as possible. We're actively using 
Twitter to make announcements about upcoming jQuery  jQuery UI updates 
and releases, new plugins and tutorials.


http://twitter.com/jquery

and

http://twitter.com/jqueryui

I urge you to follow the accounts, along with the mailing list, for 
updates and news.


Please note that we may not follow all accounts and will be using this 
primarily as a notification tool.


Rey
jQuery Project Team


[jQuery] Re: Livequery add class to new DOM elements

2008-07-16 Thread hubbs

Got it:

$(#calScrollTitle a)
.livequery(function(){
$(this).addClass('ajax').ajaxContent({
target:'#adminToolsListing',
event:'click',
loaderType:'img',
loadingMsg:'/__data/assets/image/0018/24345/announce-
loading.gif'
});
  });
});

On Jul 16, 1:29 pm, hubbs [EMAIL PROTECTED] wrote:
 Ok, I realize it is working.  But, for some reason it is not working
 with the ajaxload script.  I have a feeling I have to somehow call the
 ajaxload from within livequery.

 $('a.ajax').ajaxContent({
         target:'#adminToolsListing',
         event:'click',
         loaderType:'img',
         loadingMsg:'/__data/assets/image/0018/24345/announce-
 loading.gif'
                 });

 });

 Any ideas on how to make the two work together?

 On Jul 16, 11:34 am, noon [EMAIL PROTECTED] wrote:

  sorry, I am incorrect.  I forgot there were multiple forms.  That
  should work

  On Jul 16, 2:29 pm, noon [EMAIL PROTECTED] wrote:

   livequery accepts two parameters, the first is the event to which a
   function (the 2nd parameter) is bound to.

   $('a.someLink').livequery('click', function() {
     // anchors with a class of 'someLink'
     // can now be dynamically inserted to the dom
     // yet still have an 'onclick' event associated with them
     // as compared to the event only being bound on document ready

   });

   On Jul 16, 2:05 pm, hubbs [EMAIL PROTECTED] wrote:

I am trying to get live query to work, so that it will add a new class
to links that have just been added to the DOM through ajax.

Something is not right though:

$('a.calendarNavLink').livequery(function(){
        $(this).addClass('ajax');
            });

Have I done something wrong here?


[jQuery] Re: jqModal - How to access the iframe from the parent

2008-07-16 Thread isharerides.com

Hi there,

Just in case this helps you still, here is how I got this to work:

$(#button2).click(function() {
parent.top.$.closeDOMWindow({
closeNow:1
});
});

If you include this snippet into the site displayed in the iframe, you
can trigger the window to close by clicking on a button with the id
button2.

Hope that helps!

Phil


[jQuery] Re: Need help with animations in IE

2008-07-16 Thread The Sixth Halcon

Wow, thanks, I revised the code but I didn't see it...
So... it works!!

Thanks a lot for your time... and... see you!


[jQuery] Re: Why does IE not cache images?

2008-07-16 Thread Chris

Hi Diego,
thanks for your answer. Indeed my problem seems to be similar to that
described in the articles you posted; however, there still seems to be
a difference because the solutions didn't help. :(
First I tried to add the execCommand to my code. The behavior
changed to that effect that the ... items remaining disappeared from
the status line. Unfortunately, hand it still takes several seconds
until all images are available and I still see in the server log that
the image is requested 100 times. (Of course, the web server answers
with a 304 response each time, but IE does not seem to evaluate this
response.)
I then tried to tweak my web server. I won't have this option in the
real project because the web server belongs to the customer, but I at
least wanted to see if that solved the problem. It didn't. :(
Maybe it's important to point out that the problem does not occur when
the page is initially loading, but only when I reload the page;
however, Firefox doesn't have the problem even when I reload, and you
know how users are: They *will* try to reload the page and will then
complain that it takes some time.
I think I will redesign my whole application. The idea was to
dynamically create a table from AJAX/XML content and add edit and
delete links to each row. Since this doesn't seem to work because of
IE's nice features I will probably choose the classic way and create
the table directly in HTML.

Thanks again for your help,
Christian

On Jul 16, 1:55 pm, Diego A. [EMAIL PROTECTED] wrote:
 Hi Christian,

 It seems this problem can only be fixed by changing your server's behaviour.

 IIS:http://www.milonic.com/mfa/2005-February/ie6-not-caching-images.html

  In IIS under properties for the folder /images/menu HTTP HEADERS was set to
  Enable Content Expiration. Turning this off now allows the images to be
  cached correctly.

 Apache:http://ahinea.com/en/tech/ie-dhtml-image-caching.html

 Other useful 
 link:http://blog.httpwatch.com/2008/02/27/image-caching-in-internet-explorer/

 * Stupid IE6 *

 2008/7/16 Chris [EMAIL PROTECTED]:





  Hi list,
  I recently started using jQuery after working with plain JavaScript
  for several years. The features of jQuery are amazing!
  Now I have found a problem regarding IE's handling of dynamically
  created images. It is not really jQuery related, but maybe you can
  help me anyway.
  I have the following code snippet:

  $(document).ready(function() {
 for (var i = 0; i  100; i++)
 $('body').append('img src=images/b_edit.png
  title=Edit');
  });

  As you can see, this code creates 100 *identical* images; however, IE
  loads each image separately. (I can see it in the log file of my web
  server and it also takes a considerable time until the page is fully
  loaded.) Is there any way to change this behavior?
  If I put all the images directly in my document (not generating them
  dynamically) the image is only loaded once, but this is not an option
  for me.

  Thanks a lot,
  Christian

  P.S.: I use IE 6.0.

 --
 Cheers,
 Diego A.


[jQuery] [autocomplete] trigger function on data retrieval?

2008-07-16 Thread Jonathan Vanasco

does anyone know if it is possible to trigger a function on an
autocomplete retrieval ( using this autocomplete library
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ )

example:

i'm currently using result() to store the id of a currently selected
item in a hidden field when a user selects something.
if they hit a new key, go forwards/backwards/etc, ie - when a new
search is performed, i'd like to catch that and result that id to
null.

is this possible on the current version or should i ticket a feature
request?




[jQuery] Re: jQuery n00b needs a (seemingly) simple thing...

2008-07-16 Thread Mike Alsup

 Sorry I'm such a n00b. I have only done a couple of things with jQuery, just
 real simple stuff.
 Anyways, here's what I need:

 I need a SIMPLE slideshow/carousel script.
 It should be able to automatically slide between images (actually slide,
 like the image moves all the way to the left) every x amount of milliseconds
 Also, there has to be a pause button, and forward/backwards buttons.

 So, if it's auto-sliding the pictures, and you see one you like, you can
 pause and look at it for longer, then hit play and keep going, or click the
 forward/backward buttons to move one image at a time.

 Does it make sense?
 I've tried a few different plugins, nothing seems to have what I need.

 Any help is appreciated.
 Thanks

 -Miiitch


You can check out the Cycle plugin for simple slideshows:

http://www.malsup.com/jquery/cycle/

And there are many carousel plugins to choose from.  See
plugins.jquery.com.

Mike


[jQuery] help with passing value to jquery

2008-07-16 Thread psdp

I have a value stored in an object, and now i want to pass it to a
jquery function, please help:
var obj = {
width: 300,
   div: 'testdiv',
func: function () {
  var newwidth = this.width;
 $('#'+this.div).animate({width:newwidth+'px'}, 1000);
   }
}


[jQuery] Re: i wish there was a way to get the entire CSS for an element... or is there?

2008-07-16 Thread jquertil

ok fine so I use a class - still having the same lack of
understanding: how do I get the contents of the CSS class into a
variable?


[jQuery] Re: i wish there was a way to get the entire CSS for an element... or is there?

2008-07-16 Thread Jeffrey Kretz

Paul's site discusses how to access styles for individual elements, as well
as stylesheets, stylesheet rules and their properties:

http://www.quirksmode.org/dom/w3c_css.html

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jquertil
Sent: Wednesday, July 16, 2008 4:36 PM
To: jQuery (English)
Subject: [jQuery] Re: i wish there was a way to get the entire CSS for an
element... or is there?


ok fine so I use a class - still having the same lack of
understanding: how do I get the contents of the CSS class into a
variable?



[jQuery] Re: document.write and DOm creation - performance optimization?

2008-07-16 Thread jquertil

huh. this is an interesting thought. why would the use of join() speed
things up versus just appending a string variable?
the reason I'm not concerned about the for() loop is that it seems to
be quite fast when I output the strHTML in a document.write.

I'm trying to figure out wasy to speed up the rendering by doing
something other than html()... but I can't think of anything.


[jQuery] Re: $.getScript() - how to load into JSON formatted object?

2008-07-16 Thread jquertil

they thanks for the reply. I don't fully understand what the
parameters in this line do exactly. why is variable in 'quotation'
marks?

fn = new Function( 'variable', code );

thanks!


On Jul 8, 4:03 pm, Michael Geary [EMAIL PROTECTED] wrote:
 OK, try this. It's the same idea as the code I posted before:

 var blah = {
 dynaLoad : function( variable ) {
 $.get( 'alert.js', function( code ) {
 var fn = new Function( 'variable', code );
 fn( variable );
 });
 },
 somethingElse : ''
 };

 blah.dynaLoad('cool beans');

 -Mike

  -Original Message-
  From: jquery-en@googlegroups.com
  [mailto:[EMAIL PROTECTED] On Behalf Ofjquertil
  Sent: Tuesday, July 08, 2008 1:37 AM
  To: jQuery (English)
  Subject: [jQuery] Re: $.getScript() - how to load into JSON
  formatted object?

  thanks for the answer Mike. I probably wasn't very clear.

  I'm trying to make the loading happen as part of
  blah.something(variable).

  something kinda like this:

  var blah ={
 dynaLoad : function(variable){
$.getScript('alert.js',variable) // the script would
  simply contain the line alert(variable);
 },
 somethingElse : ''
  }

  blah.dynaLoad('cool beans'); // this would now produce a cool beans
  alertbox.


[jQuery] .width() gives me NaN (or looking for alt methods)

2008-07-16 Thread MorningZ

All right, here's my situation

I have a bunch of articles stored in my database, plain jane HTML ones
submitted by a few hundred different people (read: people of all
varying levels of HTML expertise, from none to expert)

In some of these HTML snippets are div's and tables and other
items that one way or another have a width specified (via CSS, inline
style, or width parameters)

What i need to do is take these snippets of HTML and somehow restrict
the width of these items to the size of the 'viewport' of the page (i
am making an iPhone friendly version of the site)

Now if the width's were defined in a consistent manner, then i would
just search and replace on the server when i pull the HTML from the
database, but there's so many different variations that doing this
isn't realistic

is there some way that jQuery could be of help here?

i've already taken a run at this using LiveQuery and saying:

jQuery(document).ready(function() {
   jQuery(div).livequery(function() {
   console.log('Div: ', jQuery(this).width());
   });
});


just to see if i could at least see all div's that need action taken
against them, but all i get from that is NaN  even if i could
get the div's i need, i am not sure what i could do to skinny them up
anyways

So i am open for suggestions...

oh, to see an example of this:

http://iphone.team-integra.net (no worries pulling it up in Firefox or
whatever), then click Articles, then Newest 8, and the first one
will show what i mean...  the article text is wrapped in div
style=width: 600px;/div and that's inside a Viewport that's only
320 px wide

Again, changing the text in the article isn't an option, there's
simply way too many ways over these 7+ years of articles that width
has been set

Thanks in advance


[jQuery] Re: jQuery.ajax / xml / callbacks

2008-07-16 Thread codecomplete


Further debugging shows that my request does indeed get sent to the server,
server logs show the valid request coming through and being processed just
fine.  Charles proxy shows the response coming back with a status code of
200 OK.

So basically my AJAX call above goes out and gets processed just fine,
however back in the browser, the error callback gets executed showing me
e=[object: XMLHttpRequest] and the success callback is never executed. 
Firebug does not show a request going out or coming back.  Charles proxy
shows a request going out, and coming back.

Any help would be appreciated.

-- 
View this message in context: 
http://www.nabble.com/jQuery.ajax---xml---callbacks-tp18495672s27240p18499170.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] ajax queue/stack aka fifo/lifo

2008-07-16 Thread AstroIvan

Is jquery doing either of these by default? I haven't seen requests
overwriting each other in my work, but I'm curious is this is manually
handled or not even a problem these days with xhr.


[jQuery] parent help

2008-07-16 Thread dumkat


I am returning a form in an ajax call that is built with a table
 
I want to find an input
 
$('input[{$k}]')
 
then i want the immediate parent tr of that input.
 
I have tried
 
$('input[{$k}]').parents(tr:last).addClass(error-field);
 
and
 
$('input[{$k}]').parents(/../tr:last).addClass(error-field);
 
but both solutions get a different tr that i don't want to change.
 
the html looks like
 
tr
tdE-Mail Address/td
tdinput name=email type=text value=email //td
/tr
 
and i want to add the class to the tr.
 
any help would be greatly appreciated. Thanks.
-- 
View this message in context: 
http://www.nabble.com/parent-help-tp18498309s27240p18498309.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] hover not working in IE6

2008-07-16 Thread lerrow

 Hi, I'm having some issues with a drop down menu in one of my sites
(http://www.laseleccion.com.ar/argentina). While in Firefoz it works
perfect, in IE 6 y does not display the menu at all. It works in IE 7.
 Any ideas what could be the problem?

 Thanks in advance

Leroy



[jQuery] Re: jQuery.ajax / xml / callbacks

2008-07-16 Thread codecomplete


I too am having a very similar issue where my callback is not being called. 
My error function gets called instead, and the value of e is:  [object
XMLHttpRequest]

Here is what my code looks like:

$.ajax({
url: '/member/MemberNameCheck.htm',
type: 'POST',
data: {name: $mName, ts: 2},
dataType: 'xml',
timeout: 1000,
error: function(e){
alert(error: + e);
},
success: function(xml){
alert(xml);
}
});


This is only happening to me on FireFox 2.x


twocoasttb wrote:
 
 Neither of the callbacks in the following code are ever invoked:
 
   jQuery.ajax({
 type: GET,
 url: actionUrl,
 data: { productId: productId, quantity: quantity },
 dataType: xml,
 error: function(e) { alert(Failure:  + e); },
 success: function(xml) { alert(Got Results:  + xml); } });
 
 I have verified the following:
 
 1. The url defined by 'actionUrl' is being called correctly (determined
 from server logs)
 2. The results appear to be valid (at least when I invoke the url
 manually); the content type is text/xml.
 
 What am I doing wrong here???
 

-- 
View this message in context: 
http://www.nabble.com/jQuery.ajax---xml---callbacks-tp18495672s27240p18498505.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



  1   2   >