[jQuery] Re: 1.3.2, live(event), and trigger(event, [value1, value2])

2009-10-15 Thread Val

... Anybody?  At all?

On Oct 12, 5:04 pm, Val  wrote:
> Hello all,
>
> I cannot for the life of me figure out the syntax given in the subject
> line.
>
> Through all of the following, I am referring to the examples tab of
> the following page:http://docs.jquery.com/Events/trigger
>
> I've got a 'live' event, waiting for a custom trigger.
>
> I pull the trigger, fire the event, and all goes well.
>
> However, using the following trigger syntax, data pass-through does
> not perform at all as expected:
>
> myJQueryObject.trigger('myEvent', [value1, value2]);
>
> My event gets triggered, however all passed values are totally
> ignored, so far as I can tell.  It seems to me that myliveevent's
> arguments are always firstly the event, and then myliveevent's
> selector (which is an attribute selector).  The desired passed
> information does not seem to dwell in the event object, either.
>
> As far as I can tell after about an hour of tear-jerking tests, this
> is undocumented behavior.  Furthermore, the only syntax I can coerce
> to properly function is to do the following:
>
> myJQueryObject.trigger('myEvent', {
>   type : 'myEvent',
>   var1 : value1,
>   var2 : value2
>
> });
>
> This however makes the values attributes of the 'event' object.
> Workable, but I must ask the age-old linux question: Why does the
> documentation lie to us?  I'd much prefer that either the original
> array-based syntax work as advertised, or someone alter that examples
> tab to clarify what is supposed to happen there.
>
> Thanks in advance, wonderful people.


[jQuery] 1.3.2, live(event), and trigger(event, [value1, value2])

2009-10-12 Thread Val

Hello all,

I cannot for the life of me figure out the syntax given in the subject
line.

Through all of the following, I am referring to the examples tab of
the following page: http://docs.jquery.com/Events/trigger

I've got a 'live' event, waiting for a custom trigger.

I pull the trigger, fire the event, and all goes well.

However, using the following trigger syntax, data pass-through does
not perform at all as expected:

myJQueryObject.trigger('myEvent', [value1, value2]);

My event gets triggered, however all passed values are totally
ignored, so far as I can tell.  It seems to me that my live event's
arguments are always firstly the event, and then my live event's
selector (which is an attribute selector).  The desired passed
information does not seem to dwell in the event object, either.

As far as I can tell after about an hour of tear-jerking tests, this
is undocumented behavior.  Furthermore, the only syntax I can coerce
to properly function is to do the following:

myJQueryObject.trigger('myEvent', {
  type : 'myEvent',
  var1 : value1,
  var2 : value2
});

This however makes the values attributes of the 'event' object.
Workable, but I must ask the age-old linux question: Why does the
documentation lie to us?  I'd much prefer that either the original
array-based syntax work as advertised, or someone alter that examples
tab to clarify what is supposed to happen there.

Thanks in advance, wonderful people.


[jQuery] jquery form plugin and firebug conflict

2009-06-11 Thread Val

Hi,

I am using Jquery form plugin to interact with PHP server code. When
firebug is on, the code correctly sends the data and processes the
reply from the server in Json format.
Here's the code:

var options = {
beforeSubmit:  showRequest,  // pre-submit callback
success:   processJson,  // post-submit callback
dataType: 'json',
target:   '#feedback',
clearForm: true
};
//form submit
$('#create_project_fm').ajaxSubmit(options);

function process(data){
console.log("process");
   if (data.error== "") {
   window.location.reload(true);
 } else if(data.error!="") {
 $('#feedback').addClass('error');
 $('#feedback').text('error: ' + data.error + '');
 }else {
 //feedback here
  $('#feedback').addClass('success');
  $('#feedback').text('error: ' + data.feedback + '');
 }
}

However, I have noticed that when I turn Firebug off, the server code
prints out the echo statement instead of this being parsed by the
javascript function "process" as Json.

Any help would be really appreciated.

Val


[jQuery] Re: jQuery, ajax, json, php

2009-06-11 Thread Val Cartei

with data.name (data is the json object you pass to your success
function). Like:

success: function(data) {
alert(data.name);
}

Val

On Thu, Jun 11, 2009 at 12:40 PM, David .Wu wrote:
>
> If I send a json format to php, how to get the value from php? for
> example
>
> front page
> 
> var jsonStr = '{"name": "David", "age", "23"}';
> $.ajax({
>        url: 'json.php',
>        type: 'POST',
>        cache: false,
>        data: {json: jsonStr},
>        success: function(data) {
>                alert(data);
>        }
> });
> 
>
> php page
>  $json = $_POST['json'];
>
> // it's get {"name":"David","age": "23"}, but how to gete name?
> ?>



-- 
Valentina Cartei
Telephone Numbers:
University +44 (0) 1273 877560
Work +44 (0) 1273 206306
Mobile +44 (0)796 6882820


[jQuery] Re: How best to create Google Calendar functionality in Jquery?

2009-01-15 Thread Val

Great, thanks for your help guys.  I'll play around with these
approaches and see if I can get them to work.

@fakingfantastic - I'll post back to this thread if I can get
something to work.  Would be great if you could do the same.

Thanks again,
Val

On Jan 15, 2:17 am, "Richard D. Worth"  wrote:
> You may also want to check out the jQuery UI selectable plugin. With it you
> could have a grid of DIVs or a table and with the mouse you can drag a lasso
> around cells to select and it will highlight them. See here for some demos:
>
> http://ui.jquery.com/demos/selectable
>
> - Richard
>
> On Fri, Jan 9, 2009 at 9:37 AM, jQuery Lover  wrote:
>
> > jQuery UI already has what you need.
>
> > First use a container div with bg image of time. Then create a
> > dragable and resizable div that can only be dragged/resized
> > horizontally. Then use jquery.offset() to get where the div's left and
> > right sides are and easily calculate start and end dates. Similar with
> > the vertical time spanning case.
>
> > jQuery HowTo Resource  -  http://jquery-howto.blogspot.com
>
> > On Fri, Jan 9, 2009 at 12:02 PM, Val  wrote:
>
> > > Hi,
>
> > > I'm rather new to Jquery and hope someone can point me in the right
> > > direction here.
>
> > > In my current project I need to implement some calendar event
> > > functionality (similar to Google Calendar or Mobile Me calendar).  In
> > > a nutshell, I need to be able to:
> > > - Create new div with click and drag
> > > - Resize div by clicking on handles (while updating start and end
> > > times)
> > > - Drag divs to reposition on day grid (while updating new start and
> > > end times)
>
> > > I know that JQuery UI offers some basic dragging and resizing, but
> > > I've been looking all over for a plug-in or other project that would
> > > provide the more advanced "calendar" functionality of tracking start
> > > and end times as a div is moved or resized.
>
> > > I haven't been able to find any such project in Google, however.   Can
> > > anyone point me in the direction on where to start for this type of
> > > thing?
>
> > > Thanks for your help,
> > > Val
>
>


[jQuery] How best to create Google Calendar functionality in Jquery?

2009-01-09 Thread Val

Hi,

I'm rather new to Jquery and hope someone can point me in the right
direction here.

In my current project I need to implement some calendar event
functionality (similar to Google Calendar or Mobile Me calendar).  In
a nutshell, I need to be able to:
- Create new div with click and drag
- Resize div by clicking on handles (while updating start and end
times)
- Drag divs to reposition on day grid (while updating new start and
end times)

I know that JQuery UI offers some basic dragging and resizing, but
I've been looking all over for a plug-in or other project that would
provide the more advanced "calendar" functionality of tracking start
and end times as a div is moved or resized.

I haven't been able to find any such project in Google, however.   Can
anyone point me in the direction on where to start for this type of
thing?

Thanks for your help,
Val


[jQuery] jCarousel

2008-08-18 Thread val

hi.. i have a little problem with jcarousel.. :( because i need the
carousel's container as 'display:none;'. onclick of something, the
container slides down.. now, the problem is, when it is
'display:none;' .. jcarousel doesn't work right anymore.. actually,
it's just that the UL's width is not right anymore.. so i only see 2
items.. :(

need help.