[Proto-Scripty] Re: Ajax requests again

2009-08-25 Thread Timo

On 20 Aug., 17:15, Alex Mcauley 
wrote:
> earlier on in the month i posted on how to do some things with Ajax
> requests genericaly like adding a loading message to all requests and
> i got a couple of responses but not many.
>
> I've been giving it alot of thought and i cam up with addMethods as a
> way to add some things to the Ajax Class...
>
> Could anyone give me an example of how to do this with addMethods -
> just a hello world will do then i can take it from there

I am not sure I understand what you are trying to achieve (and I
couldn't find the older topic you mention),
but did you look at Ajax.Responders? [http://www.prototypejs.org/api/
ajax/responders]

Timo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: using Element.select with capital letters in Safari.. bug?

2009-01-13 Thread Timo

Ahh yes thank you T.J.

I usualy have it but for this project i copied the wrong stuff so it
was not included and I compleatly missed to check that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] using Element.select with capital letters in Safari.. bug?

2009-01-13 Thread Timo

I have a div with the id "loginWindow" inside that i have another div
with the class ".title"
I used Element.select($('loginWindow'), '.title') to get that node.
Works very good in all other browsers but not Safari.

After some investagation i found the code that is failing
results = $A(root.querySelectorAll(e)).map(Element.extend);
in the Selector.findElements function.

However if i have no captial letters and set the id to "loginwindow"
it works in Safari.

Is this a bug in prototype or is it a Safari issue?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] AJAX JSON oddness in IE

2008-12-23 Thread timo

why do my arrays have extra methods in IE?
i guess i know why.. prototype added all these prototypes to Array()
but how do a get a responseJSON that's just an array?
it's fine in firefox... can anyone help with this?

i'm using Ajax.Request to hit a php page the returns json_encode
arrays of mysql query results.

it's all good in firefox, i get an array;
but in IE responseSJON is an object with Array's prototypes
like this:
-   transport.responseJSON  {...}   Object
+   lastIndexOf {...}   Object
+   indexOf {...}   Object
+   toJSON  {...}   Object
. then my stuff down at the bottom
+   each{...}   Object
[0] "assesment" String
[1] "category"  String
[2] "categoryquestions" String
[3] "question"  String
[4] "users" String

here's what i'm doing


the php page sets the header content type to application/json, does
the sql, then does this:

$jsonStrArray = array();
while ($record = mysqli_fetch_array($recordSet, MYSQL_ASSOC)) {
array_push($jsonStrArray, $record );
}
echo json_encode($jsonStrArray);


it returns things like this:
[{"id":"1","categoryName":"Primero Catagory"},
{"id":"2","categoryName":"The 2nd Catagory"},
{"id":"3","categoryName":"Catagory Threee!!"}]


i'm getting the responseJSON here

Ajax.Responders.register({
  onCreate: function() {
Ajax.activeRequestCount++;
  },
  onComplete: function(request, transport, json) {
 //what was the ajax requseting?
var objectName = request.parameters.objectName;
var jsonObj = transport.responseJSON; //todo:rename. 
php returns
array
if (objectName != null && jsonObj != null){
addDataObject(objectName,jsonObj);  // do 
something with the
result
}
var x = 0;
  }
});

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---