[jQuery] Re: What is the best way to send data betwen JS -> PHP

2008-06-19 Thread mmw

Use a Json serialization

script.php?request="s:e:r:i:a:l:i:z:a:t:i:o:n"

only one parameter by script, then you parse the request
it's called RPC, as well as the question the answer (if needed) should
have the same shape
it's also called IPC at kernel level, you can also use url_encode...

Cheers!

On Jun 19, 4:01 am, Harlok <[EMAIL PROTECTED]> wrote:
> Hi, I use POST for send all data to a PHP scrip, for ex:
>
> data:"script.php?id="+id+"&text="+text,
>
> but sometimes text contains \& or another strange char and I think
> that is not the better way for send data.
> ¿what is the best way? PHP -> JS I use json, but for JS->PHP?
>
> Thanks


[jQuery] object parent object

2008-06-18 Thread mmw

My code is working well, but I don't find it very smart, if someone
could give me some leads ...

;(function($) { // create closure
// constructor:
$.dict = {
keys : [],
hash :  []
};

// iterator:
$.dict.iterator = {
idx : -1,
self : $.dict // static pointer on my current constructor not
elegant a nicer way?
};
...

I would prefer something like this

$.dict = {
keys : [],
hash :  [],
iterator : {
idx : -1,
self : how to get the parent ?
}
};

any idea?


[jQuery] Re: jquery form plugin - post method do not work in firefox3

2008-06-18 Thread mmw

I didn't dig in your code but it's working for me
I tested my apps that do exactly the same thing a json-rpc
communication

client -> send
string:"hello world!"
server -> receive -> answer
string:"ok gotcha"

then I guess, it's a pratikspace's bug :)


On Jun 18, 3:31 pm, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > So if i do this on FireFox version lesser than 3 , it works nicely. data is
> > submitted, i get proper alerts. BUT when i do this in FireFox3, i get the
> > error msg, because data is empty after doing post.
>
> I've not seen any problems with FF3.  Can you use the examples
> successfully?
>
> http://www.malsup.com/jquery/form/#code-samples
>
> Mike


[jQuery] Re: SproutCore vs jQuery? Are there any comparisons out there?

2008-06-17 Thread mmw

for me sproutCore Framwork is the middle-age, prototyping everything
that's what I did before jQuery
+ a lot of bugs regarding controls, maybe sproutcore is nicer
regarding the look and feel framework and offers some facilities
for including images but that's the case with jQuery + the MVC is not
documented as well as jQuery and the the object model  is poorin
comparison to jQuery, maybe Apple choose it because it's something
that their developers can understand...


On Jun 17, 8:54 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> Yeah...that's what I thought. I've never even heard of it before WWDC.
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of Rey Bango
> Sent: Tuesday, June 17, 2008 10:29 AM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: SproutCore vs jQuery? Are there any comparisons out
> there?
>
> There are no comparisons out at the moment. While SproutCore has recently
> received a lot of press, it's been completely out of the limelight
> otherwise.
>
> Rey...
>
> Andy Matthews wrote:
> > I'm looking for comparisons between the newly popular JS library
> > SproutCore and our own favorite, jQuery.
>
> > Mostly I'm looking for feature comparisons in the area of data binding
> > and UI.
>
> > SproutCore's got to be good if Apple decided to use it for their
> > recerntly announced MobileMe online app. But why? Why not jQuery, or
> > Dojo, etc?
>
> > *
> > 
>
> > Andy Matthews
> > *Senior ColdFusion Developer
>
> > Office:  615.627.9747
> > Fax:  615.467.6249
> >www.dealerskins.com
>
> > Total customer satisfaction is my number 1 priority! If you are not
> > completely satisfied with the service I have provided, please let me
> > know right away so I can correct the problem, or notify my manager
> > Aaron West at [EMAIL PROTECTED]


[jQuery] Re: javascript runtime

2008-06-17 Thread mmw

ok

this[k] is not equal to this.push(k + ":" + v)
delete is an operator

(function($) {
// public:
   $.dict = [];

// private:
   var _len = 0;
   var _dict = [
   'set',
   'get',
   'del',
   'len',
   'toArray'
   ];

// public:
   $.dict.set = function(key, value) {
   if(!_dict.inarray(key)) {
   this[key] = value;
   _len++;
   }
   };

   $.dict.get = function(key) {
   if(!_dict.inarray(key)) {
   return this[key];
   }
   return undefined;
   };

   $.dict.del = function(key) {
   if(!_dict.inarray(key)) {
   delete this[key];
   if (_len > 0)
   _len--;
   }
   };

   $.dict.len = function() {
   return _len;
   };

   $.dict.toArray = function() {
   var a = [];
   for(k in this)
   if(!_dict.inarray(k))
   a.push(k + ":" + this[k]);
   return a;
   };

// private:
   _dict.inarray = function (v) {
   for (var i=0; i < this.length; i++)
   if (this[i] === v)
   return true;
   return false;
   };

})(jQuery);


[jQuery] javascript runtime

2008-06-16 Thread mmw

(function($) {
$.dictionary = [];

$.dictionary.setValue = function(key, value) {
this[key] = value;
};

$.dictionary.getValue = function(key) {
return this[key];
};

$.dictionary.delValue = function(key) {
this[key].delete;
};

})(jQuery);

in this example with jquery, delete doesn't work on the item, why?,
another question, the plugin constructor is an Array why its methods
are not directly "accessible"?