[jQuery] [jquery.form] file upload question

2008-03-10 Thread Dylan Verheul

I'm using the jquery forms plugin. Excellent stuff. One problem.

In my PHP-framework, I autodetect ajax/xhr requests and use an
appropriate layout. This fails when I build a form with file uploads
(the iframe trick doesnt trigger the XHR call). Is there a way to
"know"  that the page was requested through an iframe call?

Dylan


[jQuery] Re: "missing ; before statement" in ui.tabs

2008-03-10 Thread andrea varnier

On 9 Mar, 17:16, eyal <[EMAIL PROTECTED]> wrote:
> Hello,
>
> For some reason i'm having "missing ; before statement" error when i'm
> running ui.tabs altough on the demo page it's run just fine.
>
> What do think might be the problem?
>
> Thanks!
> Eyal

could you please post some of your code so we can see?
thanks :)


[jQuery] Re: display returned data from posting page

2008-03-10 Thread andrea varnier

On 9 Mar, 04:33, bwdev <[EMAIL PROTECTED]> wrote:
> I need to do a post and then have the posting page return some data
> into a var.  I've tried a few things but can't seem to get it to
> work.  Please see my pseudo code below.  How can I have the posting
> page return data via json?

hi, here it is your code, that should work:

> jQuery.post(container.url, {
> "data1":1},
> function(data){
> var rData=data
>   });

:)
andrea


[jQuery] Re: "missing ; before statement" in ui.tabs

2008-03-10 Thread Klaus Hartl

I assume you downloaded the latest version?

--Klaus


On Mar 9, 5:16 pm, eyal <[EMAIL PROTECTED]> wrote:
> Hello,
>
> For some reason i'm having "missing ; before statement" error when i'm
> running ui.tabs altough on the demo page it's run just fine.
>
> What do think might be the problem?
>
> Thanks!
> Eyal


[jQuery] Re: Turning an object into simple string

2008-03-10 Thread ajpiano

i believe the "canonical" version of the JSON api is
http://www.json.org/json2.js
see if that helps you out

--adam

On Mar 7, 11:37 am, MorningZ <[EMAIL PROTECTED]> wrote:
> I've got an object in my javascript that keeps tracks of controls and
> their values and am trying to pass it to the server to use with James
> Network-King's excellent ASP.NET Json object
>
> So it allows me to pass a JSON-d object to it and i can manipulate it
> it in my VB code
>
> Problem i am having is turning my object:
>
> var PageData = [
>         { "Tab": "Recipients", "Objects":
> ["Recipients_Choice","U_RoleList","U_Select"], "Values": ["","",""],
> "Valid": false },
>         { "Tab": "Body", "Objects":
> ["Subject_Text","BodyHtml_Text","BodyText_Text"], "Values":
> ["","",""], "Valid": false },
>         { "Tab": "Schedule", "Objects":
> ["Schedule_Start","Schedule_End","Schedule_Frequency"], "Values":
> ["","",""], "Valid": false }
> ];
>
> into a simple string to my use of the "getJSON" method
>
> $.getJSON(
>      "modules/Schedule.ashx",
>      {
>          Mode: "Save",
>          Description: Description,
>          Data: ***  The PageData object as string here 
>         },
>         function(json) {
>             if (json.HasError) {
>                      alert(json.Message);
>             }
>             else {
>                  // Code for success here with json.Data
>             }
>         }
>     );
>
> I am using this code i found (http://www.thomasfrank.se/
> json_stringify_revisited.html), but when my script hits the line:
>
> JsonString = JSON.stringify(PageData);     (and then in the getJSON
> call have "Data: JsonString" in the parameters
>
> Which works but the browser hangs for like 3 seconds (and it's
> not even that big of an object as you can see)
>
> Anyone have any suggestions to "stringify" an object using alternative
> methods (jQuery or even not)?


[jQuery] Re: slidetoggle jumps in IE

2008-03-10 Thread rocksoup

unfortunately positioning them absolutely did not solve the problem
either...

On Mar 9, 5:27 pm, "Chris J. Lee" <[EMAIL PROTECTED]> wrote:
> Actually writing a style to show or hide them isn't as helpful as
> positioning them absolutely to the way far left - at least from my
> experiences. Correct me if i'm wrong.
>
> On Mar 9, 5:11 am, Peter Edwards <[EMAIL PROTECTED]> wrote:
>
> > You could write out a style rule in your script to hide them:
> > dcoument.write('.sub_section
> > {display:none;}');
> > Or set display to none in some other way (using script so the page is
> > rendered correctly in non-javascript browsers).
>
> > on 08/03/2008 23:36 rocksou said::
>
> > > I am having an issue with the way a slidetoggle animation works in
> > > IE.  I am using the animation to show/hide div's here:
> > >http://stonebergdesign.com/clients/coop_test/wordpress/about/
> > > in FF and Safari the animation works great.  In IE the div briefly
> > > display before and after it shows/hides.  I am not a whiz at jquery
> > > and most of the code was copied and pasted...  Any help is greatly
> > > appreciated.


[jQuery] Re: pack smaller than min?

2008-03-10 Thread Paul Marcotte

Thanks!  I really missed that one... :P

Paul

On Mar 9, 3:52 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> That is if you gzip it.
>
> On 9 mar, 06:24, Paul Marcotte <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I just noticed that the download for jquery-1.2.3.min.js is 52k, while
> > pack is 29k.  Shouldn't the min version be closer to 15k?
>
> > Thanks,
>
> > Paul


[jQuery] Call a JQuery function

2008-03-10 Thread Pedro Oliveira
Hi

Is it possible to call a JQuery function from a javascript function ?

Can you show me the syntax ?

Thanks

Pedro


[jQuery] passing css to an ID via select/output

2008-03-10 Thread timfm

Hi All,

I'm new here and to jQuery. Trying to get started by developing a
typographic tools for visual designers learning CSS. I want to pass
the value of  as font-family to a div. Here's what I have so
far:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; xml:lang="en">











  The darkness of the type as set in mass, which is not the
same as the weight of the face itself. The spacing of words
and letters, the leading of lines, and the incidence of capitals, not
to mention the color (i.e., darkness) of the ink and of the paper it
is printed on, all affect the color of the type.




Courier
Georgia
Verdana




Also, strangely, if I move the #bodyCopy" div below the form it
doesn't render


[jQuery] jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...

2008-03-10 Thread [EMAIL PROTECTED]

when i implement jCarousel with options "wrap : 'both', vertical :
true, scroll : 1" and call prev method this alert apear.
I debg the script and discover that the "back" var in the "pos" method
is not set to true... so. to make t work i change the script from:

if (d == 0) {
alert('jCarousel: No width/height set for items. This will cause an
infinite loop. Aborting...');
return 0;
}

to:

if (d == 0) {
if (v == 0) {
alert('jCarousel: No width/height set for items. This will 
cause an
infinite loop. Aborting...');
return 0;
} else {
if (v < clipping) v = clipping;
break;
}
}


[jQuery] Re: callbacks calling callbacks calling callbacks ....

2008-03-10 Thread h0tzen

hi,

i have similar problems like shawn: im requesting a service to return
internet-sources for a specific media-type, e.g. video -> amazon.de,
amazon.com, imdb, ofdb, etc...
then i trigger a service for each source, reading and parsing the
source has a duration from 3-30 seconds so there is no chance to
aggregate checking the sources into one service, after all i want to
display some progress too.

currently the whole logic is already separated out in an object which
requests the services and counts to 0 to check if it has finished and
then calls back a passed delegate.
then some aggregating async functions are called, then components are
updated via events, which async callback to return their state.
i can factor out as much as possible, it keeps being some nasty code
in the controller to glue together these async-callbacks

theres no exact solution im looking for but some best-practices,
design patterns to glue async-stuff or perhaps some of this weird
javascript function-prototyping-closuring 

perhaps something like function enqueueing
function doRequestA
function doRequestB
function doRequestC
function callback

Function.prototype.enqueue(QueueIdentifier)

doRequestA.enqueue('a', callback);
doRequestA.enqueue('a', callback);
doRequestA.enqueue('a', callback);
doRequestB.enqueue('a', callback); // same queue
doRequestC.enqueue('c', callback); // new queue

or a more generic queue-impl

var q = new Queue( function() {
   //callback-handler initiating just another queue ...
   var q2 = new Queue( function() {
// and on and on and on ...
 });
   doRequestD.enqueue( q2 ) ...
   doRequestD.enqueue( q2 ) ...
   doRequestD.enqueue( q2 ) ...
   });
} );
doRequestA.enqueue( q ).call( ... )
doRequestB.enqueue( q ).call( ... )
doRequestC.enqueue( q ).call( ... )
but thats not very smart either and leads to exactly the same nested
callback-handling...

thanks for the good answers and remarks so far, appreciate any further
comment.
yours, kai


[jQuery] Re: jquery json and zend_json

2008-03-10 Thread Plant More Tree


Hi,

  I have tried the samething too by adding [] to the string but nothing is
alerted too. Anyone please kindly advice here. thanks !

regards,
Mark



jforth-2 wrote:
> 
> 
> Hey thanks for the help...
> 
> I add the [] to the string. I don't get the invalid label error but
> nothing is alerted ? No errors in fire bug.
> 
> 
> On Dec 17, 4:10 pm, "Benjamin Sterling"
> <[EMAIL PROTECTED]> wrote:
>> wrap it in [] like:
>> [{"job_Description":"My Job","job_Notes":"My jobs notes are here."}]
>>
>> On 12/17/07, jforth <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>
>>
>> > I'm running php 5.2.5
>>
>> > in firebug I get :
>>
>> > invalid label
>>
>> > {"job_Description":"My Job","job_Notes":"My jobs notes are here."}
>>
>> > On Dec 12, 1:38 pm, "Benjamin Sterling"
>> > <[EMAIL PROTECTED]> wrote:
>> > > Two quick questions:
>> > > what version of php are you running?  I believe that zend only
>> supports
>> > > php5, but I could be wrong on that.
>>
>> > > In firebug, what is being returned in the "response" tab?
>>
>> > > On 12/12/07, jforth <[EMAIL PROTECTED]> wrote:
>>
>> > > > I'm trying to test something here and having issues getting it to
>> > > > work.
>>
>> > > > here's my jquery script : // I should get an alert object if it
>> works?
>> > > > but in firebug all I get is invalid label.
>>
>> > > > var url = "http://127.0.0.1/projects/micro-printing.com/projects/
>> > > > micro-server/index.php/client_api/test?callback=?";
>> > > > $.getJSON(url,
>> > > > function(data){
>> > > > alert(data);
>> > > > });
>>
>> > > > heres the json that I'm  getting using zend_json:
>>
>> > > > {"job_Description":"My Job","job_Notes":"My jobs notes are here."}
>>
>> > > > and here's the php in case it helps
>>
>> > > > $json = new Zend_Json();
>> > > > $job_data = array(
>> > > > 'job_Description' => 'My Job' ,
>> > > > 'job_Notes' => 'My jobs notes are here.');
>>
>> > > > echo $json->encode($job_data);
>>
>> > > --
>> > > Benjamin
>> >
>> Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjam...
>>
>> --
>> Benjamin
>> Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjaminsterling.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/jquery-json-and-zend_json-tp14300277s27240p15950633.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Dom manipulation with frames leaking divs

2008-03-10 Thread Zak

Take a look at the simple example below.  The following divs are
reported as leaked by Drip --  div.  These divs are
not from my code but I did notice them in a function called "clean" in
jquery core.js

file1.htm >> src:






frame.htm >> src:




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

function leak(){
$("#mydiv").append(":leak ");
}

function noleak(){
var text = document.createTextNode(':noleak ');
$("#mydiv").append(text);
}


should be appended here
leak
noleak


>>

This will leak one set of divs (2 divs) each time you click the leak
link.  The noleak link does not leak anything.  This issue only occurs
when the source is inside a frameset.  In my application this scenario
is actually causing all nodes of large dynamically built tables to
leak.  When the page is served without the frameset there are no
leaks.  Does anyone have any idea what's going on in this example?


[jQuery] Re: neewbe help, Bassistance Validation Plugin

2008-03-10 Thread Patrik Nikkanen

If you only want one balloon, then try something like this code. Only 
problem is that if the error changes while the user edits the inputs, the 
balloon won't change. You might be able to solve this with some function 
that updates the balloon on keyup events, or something similar.

$(function() {
 $(":checkbox,:text,:radio,:password,:file,textarea").focus(function(){
  $("#balao").hide();
  $("#setabox").empty();
  var sCont = $(this).next('div').children('label').contents()
  if(sCont.length) {
   $("#setabox").append(sCont);
   var bplace = $(this).offset();
   bplace.left += $(this).width();
   bplace.top += Math.round($(this).height()/2)-23;
   $("#balao").css(bplace);
   $("#balao").fadeIn("fast",function(){});
  }
 });

 $("#fteste").validate({
  rules:{
   T1:{ required: true, email:true },
   S1:{ required: true }
  }, messages:{
   T1: { required: "Enter a e-mail!", email: "Enter a valid e-mail!" },
   S1: { required: "Provide a text" }
  },
  errorPlacement:function(error, element){
   error.appendTo( $('').appendTo(element.parent("p")) );
  }
 });
});


- Original Message - 
From: "Alexsandro_xpt" <[EMAIL PROTECTED]>
To: "jQuery (English)" 
Sent: Saturday, March 08, 2008 2:38 PM
Subject: [jQuery] Re: neewbe help, Bassistance Validation Plugin


>
> Thank you for atencion!
>
> Good say about inputs onfocus events. I will try that.
>
> But about "use the errorPlacement option to put the error messages in
> hidden balloons belonging to the respective fields"
> I wish using only one hidden balloons, in last case use several hidden
> balloons.
>
> The interesting is get erro messages for each focus input invalid.
>
> Have you one idea?
>
>
> Thank you



[jQuery] Re: Trying to get a submit button to countdown before being enabled again

2008-03-10 Thread alan

Ok, as an extension of this problem, I also realized that the input
forms themselves could still be submitted by hitting 'enter' (in
safari), so I am trying to get htem to disable themselves, but for
some unbelievably frustrating reason, they stay enabled:

function timeOutButton() {

$('#form-name').val("").attr("disabled","disabled");
$('#form-message').val("").attr("disabled","disabled");

var countdown;
var timer = ;
if ($('#form-submit').val() == 'say hi!') {
$('#form-submit').attr('disabled','disabled');
 countdown = setInterval(function() {
 if (timer > 0) {
 $('#form-submit').val(timer);
 timer = timer -1;
 } else {
$('#form-submit').val('say 
hi!');

$('#form-submit').removeAttr('disabled');
clearInterval(countdown);
return;
 }
 }, 1000);

}
$('#form-name').removeAttr('disabled');
$('#form-message').removeAttr('disabled');
}

If anyone has any idea why this code simply isn't working, it would be
greatly appreciated.

thank you!
alan

On Mar 8, 12:10 pm, alan <[EMAIL PROTECTED]> wrote:
> Hi Karl,
> Thanks a ton, that works absolutely perfectly, I think that setting
> the interval is definitely a better way than using the animate trick
> for something like this! Not only that, I didn't know about firebug
> before which is now a huge help! I was struggling with setting manual
> alerts all over the place beforehand!
>
> thanks again!
> alan
>
> On Mar 8, 9:44 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
>
> > Hi Alan,
>
> > This should do the trick (tested in Firebug):
>
> > var countdown;
> > var timer = 5;
> > if ( $('#form-submit').val() == 'Submit') {
> >  countdown = setInterval(function() {
> >  if (timer > 0) {
> >  $('#form-submit').val(timer);
> >  timer = timer -1;
> >  } else {
> > $('#form-submit').val('Submit');
> > clearInterval(countdown);
> > return;
> >  }
> >  }, 1000);
>
> > }
>
> > --Karl
> > _
> > Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> > On Mar 8, 2008, at 5:56 AM, alan wrote:
>
> > > Hi,
> > > I am trying to get a submit button, once clicked, to disable itself,
> > > countdown, then reenable itself to prevent a form from being submitted
> > > too rapidly.
>
> > > I've figured it out, but in a way that I think is pretty messy and not
> > > very scalable, I'm wondering if I am going about this the wrong way
> > > and if there is a more efficient way to code something like this?
>
> > > ---
>
> > > $("#form-submit").attr("value",5).animate({opacity: 1.0}, 1000,
> > > function() {
> > >
> > > $("#form-submit").attr("value",4).animate({opacity: 1.0}, 1000,
> > > function() {
> > >
> > > $("#form-submit").attr("value",3).animate({opacity: 1.0}, 1000,
> > > function() {
> > >
> > > $("#form-submit").attr("value",2).animate({opacity: 1.0}, 1000,
> > > function() {
> > >
> > > $("#form-submit").attr("value",1).animate({opacity: 1.0}, 1000,
> > > function(){
> > >
> > > $("#form-submit").attr("disabled",false);
> > >
> > > $("#form-submit").attr("value","Submit");
> > >})
> > >})
> > >})
> > >})
> > >});
>
> > > ---
>
> > > Thanks a lot!
>
> > > Alan


[jQuery] Snap to grid on BBC website

2008-03-10 Thread Rui Pacheco

Hi all

I am currently evaluating the jQuery library, along with some other JS
libraries for my company, and we decided to implement the same
functionality the BBC homepage has. I managed to reproduce all the
effects quite quickly apart from the snap to grid. Can anyone send me
on the right direction?

iGoogle seems to have the same functionality and I know they also use
jQuery. Are they using it on iGoogle or are they doing it using their
own JS libraries?

Many thanks for your help.
Rui


[jQuery] Re: Snap to grid on BBC website

2008-03-10 Thread Andy Matthews

iGoogle doesn't use jQuery. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rui Pacheco
Sent: Monday, March 10, 2008 6:22 AM
To: jQuery (English)
Subject: [jQuery] Snap to grid on BBC website


Hi all

I am currently evaluating the jQuery library, along with some other JS
libraries for my company, and we decided to implement the same functionality
the BBC homepage has. I managed to reproduce all the effects quite quickly
apart from the snap to grid. Can anyone send me on the right direction?

iGoogle seems to have the same functionality and I know they also use
jQuery. Are they using it on iGoogle or are they doing it using their own JS
libraries?

Many thanks for your help.
Rui




[jQuery] Re: Snap to grid on BBC website

2008-03-10 Thread Benjamin Sterling
Rui,
Take a look at the ui.jquery.com site, and look at the sortable, that
"should" be what you want.

On 3/10/08, Rui Pacheco <[EMAIL PROTECTED]> wrote:
>
>
> Hi all
>
> I am currently evaluating the jQuery library, along with some other JS
> libraries for my company, and we decided to implement the same
> functionality the BBC homepage has. I managed to reproduce all the
> effects quite quickly apart from the snap to grid. Can anyone send me
> on the right direction?
>
> iGoogle seems to have the same functionality and I know they also use
> jQuery. Are they using it on iGoogle or are they doing it using their
> own JS libraries?
>
> Many thanks for your help.
>
> Rui
>



-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com


[jQuery] Re: passing css to an ID via select/output

2008-03-10 Thread Richard D. Worth
Maybe you want:

$("#bodyCopy").css("font-family", $(this).val());

Also, you don't have a  before your .

- Richard

Richard D. Worth
http://rdworth.org/

On Sun, Mar 9, 2008 at 10:27 PM, timfm <[EMAIL PROTECTED]> wrote:

>
> Hi All,
>
> I'm new here and to jQuery. Trying to get started by developing a
> typographic tools for visual designers learning CSS. I want to pass
> the value of  as font-family to a div. Here's what I have so
> far:
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> http://www.w3.org/1999/xhtml"; xml:lang="en">
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
>  The darkness of the type as set in mass, which is not the
> same as the weight of the face itself. The spacing of words
> and letters, the leading of lines, and the incidence of capitals, not
> to mention the color (i.e., darkness) of the ink and of the paper it
> is printed on, all affect the color of the type.
> 
>
> 
>
>Courier
>Georgia
>Verdana
> 
> 
> 
>
> Also, strangely, if I move the #bodyCopy" div below the form it
> doesn't render
>