[Proto-Scripty] Re: Bizzarre goings on

2009-06-10 Thread Alex McAuley

The JSON returned is ok - this was the first thng i checked

Here is the returned JSON..

{Error:No,ErrorMessage:None,Refresh:1}

As you can see from that and the code i pastebinned there is no trailing 
comma anywhere.. and it -was- working perfectly fine then just stopped !!

This is really confusing, i will continue to investigate !

Thanks
Alex

- Original Message - 
From: david david.brill...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Tuesday, June 09, 2009 10:09 PM
Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON  ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 
 


--~--~-~--~~~---~--~~
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] Need clarification or guidance regarding arrays/hashes

2009-06-10 Thread Luisgo

I've been a long time user of prototype and feel very comfortable in
most areas but this keeps coming up and I find it very annoying.

I have a hash that, as the code executes is filled with numeric ID's
as hash variable names. I basically need it to end up sort of like
this:

{
'4567':{},
'9546':{},
'6497':{},
...
}

The problem is the IDs are passed as strings but casted as integers
when I do:

myHash.set( idPassedInVariable, {} );

This causes the hash to be filled by undefined items where the
missing numeric IDs would be. In the example above I would end up
with 0 to 4566 being undefined and every space in between the rest of
the keys.

Am I doing something wrong? Isn't there a way to make set pass the
string or is javascript simply going to force it to be a number?

Thanks!

--~--~-~--~~~---~--~~
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: Problems with the down() function and the new Browser Generation

2009-06-10 Thread Luisgo

Tears of joy!!!

Thank you for this. I have been changing a ton of code thinking the
problem was in prototype and it was simply that I was using IDs just
like you. I added a simple freaking character to the IDs and presto!

I had already filed a ticket for this here:
https://prototype.lighthouseapp.com/projects/8886/tickets/704-downselect-failing-in-ie8
(now closed)

Thanks again!

On Jun 8, 11:17 am, Posseidon possei...@aon.at wrote:
 Hi guys

 Thank you for the answer!
 The problem was self made! It seems that the new Browser Generation is
 more with the Standards. I had as ID attribute only a number. And this
 is since HTML 4 wrong.
 an ID Attribute must not start with a number or must not be a number
 only!

 td id=456 -- was wrong
 now i fixed it like td id=gb_456 and i get out the id with id.split
 ('_')[1]

 thx for all answers...

 Best regards

 Posseidon

 On Jun 8, 12:34 pm, david david.brill...@gmail.com wrote:



  Hi Posseidon,

  The actual prototype is compatible with safari =3, opera =9 and
  IE=8.
  I think you should open a ticket to lighthouse. the url 
  ishttps://prototype.lighthouseapp.com/projects/8886-prototype

  The code is very difficult to test, perhaps if we'll have an XHR input
  to test with ??

  --
  david

  On 7 juin, 13:57, Posseidon possei...@aon.at wrote:

   Hi guys...

   I have some Problems in all modern Browsers (IE8, Safari4, Opera10)
   using the Element.down() function. I'm building with a Template a list
   of div containers and in those containers there is some text and two
   buttons. The buttons come when the User has the right rights to click
   on them. After the creation of this containers i look with Element.down
   ('img.buttonDelete') if there is the image inserted or not. But when i
   use this function the Browser stops the insertion. It looks like there
   is an error but no browser fires an error at all. here is some code..

   var gbEtmpl = new Template('div id=#{eid} style=padding-bottom:
   5px;' +
                                'div style=text-align:left; width:100%;
   height:93px; background-image:url(./pics/site/main/gbback_02.png);
   background-repeat:no-repeat;'+
                                  'div style=padding-top:55px; padding-
   left:20px; font-family:Arial Black, Verdana; color:#00; font-size:
   13px; font-weight:500;'+
                                    '#{hl}'+
                                  '/div'+
                                '/div'+
                                'div style=width:100%; text-align:left;
   background-image:url(./pics/site/main/gbback_03.png); background-
   repeat:repeat-y;'+
                                  'div style=min-height:100px; padding-
   top:10px; padding-left:20px; padding-right:30px;'+
                                    '#{msg}'+
                                  '/div'+
                                '/div'+
                                'div style=background-image:url(./pics/
   site/main/gbback_05.png); background-repeat:no-repeat;'+
                                  'div class=clearfix style=height:
   43px; padding-top:15px; margin-left:15px;'+
                                    'div style=line-height:18px;
   float:left; width:49%; text-align:left;'+
                                      '#{ed}nbsp;nbsp;#{ee}nbsp;nbsp;#
   {date} #{time} #{uname}'+
                                    '/div'+
                                    'div style=line-height:18px;
   float:left; width:50%; text-align:right;'+
                                      'div style=padding-right:15px;'
   +
                                        '#{em} #{hp} #{icq} #{aim} #{yim}
   #{msn} #{xf}'+
                                      '/div' +
                                    '/div'+
                                  '/div'+
                                '/div'+
                              '/div');

   function showEntrys( XHR )
   {
     var e, i, imgObject;
     edata = XHR.entrys;
     $('entrys').childElements().invoke('remove');
     for( i = 0; i  edata.length; i++ ) {
       e = edata[i];
       $('entrys').insert( gbEtmpl.evaluate({ eid:e.eid, hl:e.hl,
   date:e.date, time:e.time, uname:e.uname, msg:e.msg, icq:e.icq,
   aim:e.aim, yim:e.yim,
                                              msn:e.msn, xf:e.xf,
   hp:e.hp, em:e.em, ed:e.ed, ee:e.ee }) );
       alert( e.eid );
       if( $( e.eid ).down('img.gbEditButton') ) alert('isda');
       if( $( e.eid ).down('img.gbEditButton') != undefined ) $
   ( e.eid ).down('img.gbEditButton').onclick = showEditEntry;
       if( $( e.eid ).down('img.gbDeleteButton') != undefined ) $
   ( e.eid ).down('img.gbDeleteButton').onclick = msgBoxDeleteEntry;
     }

   }

   I have two alerts in there to show you how far the browser comes with
   parsing... In Firefox there is no Problem both alerts are coming and
   the insertion goes till the end... this code worked one year and now
   with the new Browser generation something is going wrong...

   

[Proto-Scripty] Prototype still causes ie7 to hang ?

2009-06-10 Thread Nadav Blum

Hi there
I suspect that prototype 1.6.03 causes ie7 to hang occasionally after
loading page. Is it plausible?
I understood from previous posts that the issue has been solved.
(http://groups.google.com/group/prototype-scriptaculous/browse_thread/
thread/a1c745463251a95d/548baf3fcd66c6de?lnk=gstq=ie
+hang#548baf3fcd66c6de)
 Or maybe not yet ?
Should I replace (line 4124:)
document.write(script id=__onDOMContentLoaded defer src=//:\/
script);
with
document.write(script id=__onDOMContentLoaded defer
src='//:blank.js'\/script);

??

Thanks so much



Nadav



--~--~-~--~~~---~--~~
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] problem this code?

2009-06-10 Thread favril

use prototype-1.6.0.3

 code 
var array = [];
console.log('length: ' + array.length);
for(var i in array) {
  console.log('key: ' + i);
  console.log('val: ' + array[i]);
}
/ code 

 result 
length: 0
key: each
val: function (iterator, context) { ... }
key: eachSlice
val: function (number, iterator, context) { ... }
  ...
key: toJSON
val: function () { ... }
/ result 


if use prototype.js, can't use for..in for Array object ?


--~--~-~--~~~---~--~~
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: problem this code?

2009-06-10 Thread T.J. Crowder

Hi,

 if use prototype.js, can't use for..in for Array object ?

Correct, and even if not using Prototype, you shouldn't use for..in
for that.  That's not what it's for.  More here:
http://proto-scripty.wikidot.com/prototype:tip-looping-through-arrays

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available

On Jun 10, 3:15 am, favril hsanog...@gmail.com wrote:
 use prototype-1.6.0.3

  code 
 var array = [];
 console.log('length: ' + array.length);
 for(var i in array) {
   console.log('key: ' + i);
   console.log('val: ' + array[i]);}

 / code 

  result 
 length: 0
 key: each
 val: function (iterator, context) { ... }
 key: eachSlice
 val: function (number, iterator, context) { ... }
   ...
 key: toJSON
 val: function () { ... }
 / result 

 if use prototype.js, can't use for..in for Array object ?
--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread Richard Quadling

2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON  ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


What is the header you are using in the JSON response?

Normally, if you use an appropriate header, you don't need to
evalJSON() as this is done for you and presented as the second
parameter to the onSuccess() callback.



-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread Alex McAuley

As i said it was working and nothing changed except one line an -  
if($('overlay')) {...}

whihc i have now removed .. its very weird, i will strip it down to bear 
minimum and build it up agian

I really hate debugging Internet explorer as using debug bar - the line 
numbers and charachters do not match what is going on!!

- Original Message - 
From: Richard Quadling rquadl...@googlemail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 10, 2009 10:17 AM
Subject: [Proto-Scripty] Re: Bizzarre goings on



2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


What is the header you are using in the JSON response?

Normally, if you use an appropriate header, you don't need to
evalJSON() as this is done for you and presented as the second
parameter to the onSuccess() callback.



-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!




--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread Alex McAuley

Well someone may be interested to know i found the problem!!...

var dims=document.body.getDimensions(); // wrong
var dims=$(document.body).getDimensions(); // correct !!!


what i cant understand is how it was once working and then stopped for no 
reason !!

Thanks for help

ALex


- Original Message - 
From: Alex McAuley webmas...@thecarmarketplace.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 10, 2009 10:26 AM
Subject: [Proto-Scripty] Re: Bizzarre goings on



 As i said it was working and nothing changed except one line an - 
 if($('overlay')) {...}

 whihc i have now removed .. its very weird, i will strip it down to 
 bear
 minimum and build it up agian

 I really hate debugging Internet explorer as using debug bar - the line
 numbers and charachters do not match what is going on!!

 - Original Message - 
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:17 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


 What is the header you are using in the JSON response?

 Normally, if you use an appropriate header, you don't need to
 evalJSON() as this is done for you and presented as the second
 parameter to the onSuccess() callback.



 -- 
 -
 Richard Quadling
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!




 
 


--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread Richard Quadling

2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 As i said it was working and nothing changed except one line an - 
 if($('overlay')) {...}

 whihc i have now removed .. its very weird, i will strip it down to bear
 minimum and build it up agian

 I really hate debugging Internet explorer as using debug bar - the line
 numbers and charachters do not match what is going on!!

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:17 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


 What is the header you are using in the JSON response?

 Normally, if you use an appropriate header, you don't need to
 evalJSON() as this is done for you and presented as the second
 parameter to the onSuccess() callback.



 --
 -
 Richard Quadling
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!




 


You could use FireBugLite [1]. Offers a lot of the facilities found in
its big brother in FireFox.

You can then use console.info() calls in your code to help report what
is going on.

Regards,

Richard.

[1] http://getfirebug.com/lite.html
-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread Alex McAuley

yes i have debugbar reporting everything, its very weird as i use similar 
code to that line on another page and debugbar reports it as invalid 
object

Just not on this page ...

It could be my other page is development and i dont minify or concat any 
JS/CSS together but on this page everything is concated into one file at 
runtime and minified (except prototype as we know how that hates to be 
minified in certain ways!!) ...

As i say its very bizarre but at least its fixed now

Thanks for help / advice guys

Alex


- Original Message - 
From: Richard Quadling rquadl...@googlemail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 10, 2009 10:32 AM
Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Richard Quadling rquadl...@googlemail.com:
 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 As i said it was working and nothing changed except one line an - 
 if($('overlay')) {...}

 whihc i have now removed .. its very weird, i will strip it down to 
 bear
 minimum and build it up agian

 I really hate debugging Internet explorer as using debug bar - the line
 numbers and charachters do not match what is going on!!

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:17 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no 
 trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped 
 !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when 
 it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt 
 reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


 What is the header you are using in the JSON response?

 Normally, if you use an appropriate header, you don't need to
 evalJSON() as this is done for you and presented as the second
 parameter to the onSuccess() callback.



 --
 -
 Richard Quadling
 Zend Certified Engineer : 
 http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!




 


 You could use FireBugLite [1]. Offers a lot of the facilities found in
 its big brother in FireFox.

 You can then use console.info() calls in your code to help report what
 is going on.

 Regards,

 Richard.

 [1] http://getfirebug.com/lite.html
 --
 -
 Richard Quadling
 Zend Certified Engineer : 
 http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!


 Do you have IE reporting all errors? Very useful for this sort of
 thing as I would have expected to see an error for that line if it was
 not valid.

 -- 
 -
 Richard Quadling
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!

 
 


--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread Richard Quadling

2009/6/10 Richard Quadling rquadl...@googlemail.com:
 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 As i said it was working and nothing changed except one line an - 
 if($('overlay')) {...}

 whihc i have now removed .. its very weird, i will strip it down to bear
 minimum and build it up agian

 I really hate debugging Internet explorer as using debug bar - the line
 numbers and charachters do not match what is going on!!

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:17 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


 What is the header you are using in the JSON response?

 Normally, if you use an appropriate header, you don't need to
 evalJSON() as this is done for you and presented as the second
 parameter to the onSuccess() callback.



 --
 -
 Richard Quadling
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!




 


 You could use FireBugLite [1]. Offers a lot of the facilities found in
 its big brother in FireFox.

 You can then use console.info() calls in your code to help report what
 is going on.

 Regards,

 Richard.

 [1] http://getfirebug.com/lite.html
 --
 -
 Richard Quadling
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!


Do you have IE reporting all errors? Very useful for this sort of
thing as I would have expected to see an error for that line if it was
not valid.

-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

--~--~-~--~~~---~--~~
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: problem this code?

2009-06-10 Thread favril

Thank you for help.

I understood this.

Thanks again!


On Jun 10, 5:42 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 Hi,

  if use prototype.js, can't use for..in for Array object ?

 Correct, and even if not using Prototype, you shouldn't use for..in
 for that.  That's not what it's for.  More 
 here:http://proto-scripty.wikidot.com/prototype:tip-looping-through-arrays

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available

 On Jun 10, 3:15 am, favril hsanog...@gmail.com wrote:

  use prototype-1.6.0.3

   code 
  var array = [];
  console.log('length: ' + array.length);
  for(var i in array) {
    console.log('key: ' + i);
    console.log('val: ' + array[i]);}

  / code 

   result 
  length: 0
  key: each
  val: function (iterator, context) { ... }
  key: eachSlice
  val: function (number, iterator, context) { ... }
    ...
  key: toJSON
  val: function () { ... }
  / result 

  if use prototype.js, can't use for..in for Array object ?
--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread Alex McAuley

Richard.

On a slight side note is it possible to evaluate the response from the 
request to see if it is Json or HTML ...

In the backend i can output whatever header i like and i would like to on 
the request evaluate if it is JSON (and if so do something) or if its 
text/html/javascript do somehting else 

Is this possible with prototypejs

Regards
Alex

- Original Message - 
From: Richard Quadling rquadl...@googlemail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 10, 2009 10:31 AM
Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 As i said it was working and nothing changed except one line an - 
 if($('overlay')) {...}

 whihc i have now removed .. its very weird, i will strip it down to 
 bear
 minimum and build it up agian

 I really hate debugging Internet explorer as using debug bar - the line
 numbers and charachters do not match what is going on!!

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:17 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped 
 !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


 What is the header you are using in the JSON response?

 Normally, if you use an appropriate header, you don't need to
 evalJSON() as this is done for you and presented as the second
 parameter to the onSuccess() callback.



 --
 -
 Richard Quadling
 Zend Certified Engineer : 
 http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!




 


 You could use FireBugLite [1]. Offers a lot of the facilities found in
 its big brother in FireFox.

 You can then use console.info() calls in your code to help report what
 is going on.

 Regards,

 Richard.

 [1] http://getfirebug.com/lite.html
 -- 
 -
 Richard Quadling
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!

 
 


--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread Richard Quadling

2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 Richard.

 On a slight side note is it possible to evaluate the response from the
 request to see if it is Json or HTML ...

 In the backend i can output whatever header i like and i would like to on
 the request evaluate if it is JSON (and if so do something) or if its
 text/html/javascript do somehting else 

 Is this possible with prototypejs

 Regards
 Alex

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:31 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 As i said it was working and nothing changed except one line an - 
 if($('overlay')) {...}

 whihc i have now removed .. its very weird, i will strip it down to
 bear
 minimum and build it up agian

 I really hate debugging Internet explorer as using debug bar - the line
 numbers and charachters do not match what is going on!!

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:17 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped
 !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


 What is the header you are using in the JSON response?

 Normally, if you use an appropriate header, you don't need to
 evalJSON() as this is done for you and presented as the second
 parameter to the onSuccess() callback.



 --
 -
 Richard Quadling
 Zend Certified Engineer :
 http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!




 


 You could use FireBugLite [1]. Offers a lot of the facilities found in
 its big brother in FireFox.

 You can then use console.info() calls in your code to help report what
 is going on.

 Regards,

 Richard.

 [1] http://getfirebug.com/lite.html
 --
 -
 Richard Quadling
 Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!

 



 


Use the appropriate headers on the server.

If you send (PHP) ...

header({$_SERVER['SERVER_PROTOCOL']} 200 OK, True, 200);
header('Content-type: X-JSON');
echo json_encode($m_Response);

or

header({$_SERVER['SERVER_PROTOCOL']} 200 OK, True, 200);
header('Content-type: application/javascript');
echo {$_POST['JSONP']}( . json_encode($m_Response) . '); //';

for JSON/JSONP, then prototype will handle it correctly.

But if you are NOT sending JSON encoded data, but straight HTML, then
you use the text/html content type.

So. When this gets to prototype, the second param will be populated
for the JSON data (up to you to process the object).
The JS will be executed for JSONP (you don't need to do anything else).
The HTML will be sent to the appropriate container (if you are using
an updater request).

No need to determine anything. Just use the right headers.

Well, you could test to see if the second param to the onSuccess is
present. If so, then it is JSON, if not then it is not.
-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

--~--~-~--~~~---~--~~
You received this 

[Proto-Scripty] Re: Bizzarre goings on

2009-06-10 Thread Alex McAuley

So'k i sorted it .

On the PHP end i do this ...

 header('Content-Type: application/json');// text/html



and on

the onSuccess i do this ...


onSuccess : function(d) {

   var header=d.getHeader('Content-Type')
if(header=='application/json') {
 var data=d.responseText.evalJSON();
} else  { ..

This has saved me hours of work 

Regards
Alex

- Original Message - 
From: Richard Quadling rquadl...@googlemail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Wednesday, June 10, 2009 11:02 AM
Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 Richard.

 On a slight side note is it possible to evaluate the response from the
 request to see if it is Json or HTML ...

 In the backend i can output whatever header i like and i would like to on
 the request evaluate if it is JSON (and if so do something) or if its
 text/html/javascript do somehting else 

 Is this possible with prototypejs

 Regards
 Alex

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:31 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 As i said it was working and nothing changed except one line an - 
 if($('overlay')) {...}

 whihc i have now removed .. its very weird, i will strip it down to
 bear
 minimum and build it up agian

 I really hate debugging Internet explorer as using debug bar - the line
 numbers and charachters do not match what is going on!!

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:17 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no 
 trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped
 !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when 
 it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt 
 reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


 What is the header you are using in the JSON response?

 Normally, if you use an appropriate header, you don't need to
 evalJSON() as this is done for you and presented as the second
 parameter to the onSuccess() callback.



 --
 -
 Richard Quadling
 Zend Certified Engineer :
 http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!




 


 You could use FireBugLite [1]. Offers a lot of the facilities found in
 its big brother in FireFox.

 You can then use console.info() calls in your code to help report what
 is going on.

 Regards,

 Richard.

 [1] http://getfirebug.com/lite.html
 --
 -
 Richard Quadling
 Zend Certified Engineer : 
 http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!

 



 


 Use the appropriate headers on the server.

 If you send (PHP) ...

 header({$_SERVER['SERVER_PROTOCOL']} 200 OK, True, 200);
 header('Content-type: X-JSON');
 echo json_encode($m_Response);

 or

 header({$_SERVER['SERVER_PROTOCOL']} 200 OK, True, 200);
 header('Content-type: application/javascript');
 echo {$_POST['JSONP']}( . json_encode($m_Response) . '); //';

 for JSON/JSONP, then prototype will handle it correctly.

 But if you are NOT sending JSON encoded data, but straight HTML, then
 you use the text/html content type.

 So. When this gets to prototype, the second param will be populated
 for the 

[Proto-Scripty] Re: Bizzarre goings on

2009-06-10 Thread Richard Quadling

2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 So'k i sorted it .

 On the PHP end i do this ...

  header('Content-Type: application/json');// text/html



 and on

 the onSuccess i do this ...


 onSuccess : function(d) {

       var header=d.getHeader('Content-Type')
        if(header=='application/json') {
         var data=d.responseText.evalJSON();
        } else  { ..

 This has saved me hours of work 

 Regards
 Alex

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 11:02 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 Richard.

 On a slight side note is it possible to evaluate the response from the
 request to see if it is Json or HTML ...

 In the backend i can output whatever header i like and i would like to on
 the request evaluate if it is JSON (and if so do something) or if its
 text/html/javascript do somehting else 

 Is this possible with prototypejs

 Regards
 Alex

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:31 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 As i said it was working and nothing changed except one line an - 
 if($('overlay')) {...}

 whihc i have now removed .. its very weird, i will strip it down to
 bear
 minimum and build it up agian

 I really hate debugging Internet explorer as using debug bar - the line
 numbers and charachters do not match what is going on!!

 - Original Message -
 From: Richard Quadling rquadl...@googlemail.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, June 10, 2009 10:17 AM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 2009/6/10 Alex McAuley webmas...@thecarmarketplace.com:

 The JSON returned is ok - this was the first thng i checked

 Here is the returned JSON..

 {Error:No,ErrorMessage:None,Refresh:1}

 As you can see from that and the code i pastebinned there is no
 trailing
 comma anywhere.. and it -was- working perfectly fine then just stopped
 !!

 This is really confusing, i will continue to investigate !

 Thanks
 Alex

 - Original Message -
 From: david david.brill...@gmail.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, June 09, 2009 10:09 PM
 Subject: [Proto-Scripty] Re: Bizzarre goings on



 Hi Alex,

 If the code WAS working, the error could be on the received JSON ?
 One though, IE don't like misplaced comma on JSON. For exemple, last
 element of an array that is followed by a comma don't work on IE.

 --
 david


 On 9 juin, 16:31, Jeztah webmas...@thecarmarketplace.com wrote:
 AFternoon guys/gals

 http://pastie.org/505747

 Some weird behaviour in internet explorer .

 The code in the link above works in all browsers except Internet
 explorer . It was working untill earlier today and i am now not
 sure why... i have reverted any changes back to what they were when
 it
 was working 

 At a glance can anyone see an error that would halt Internet
 Explorer

 The strange thing is .. IE doesnt even throw an error, it does the
 requests fine just doesnt do the bits after - its like it isnt
 reading
 the JSON response

 As i said its working in all other browsers fine and has been for a
 while so i know its not the backend response as it used to work in
 IE!!..

 Thanks in advance

 Alex
 



 


 What is the header you are using in the JSON response?

 Normally, if you use an appropriate header, you don't need to
 evalJSON() as this is done for you and presented as the second
 parameter to the onSuccess() callback.



 --
 -
 Richard Quadling
 Zend Certified Engineer :
 http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!




 


 You could use FireBugLite [1]. Offers a lot of the facilities found in
 its big brother in FireFox.

 You can then use console.info() calls in your code to help report what
 is going on.

 Regards,

 Richard.

 [1] http://getfirebug.com/lite.html
 --
 -
 Richard Quadling
 Zend Certified Engineer :
 http://zend.com/zce.php?c=ZEND002498r=213474731
 Standing on the shoulders of some very clever giants!

 



 


 Use the appropriate headers on the server.

 If you send (PHP) ...

 header({$_SERVER['SERVER_PROTOCOL']} 200 OK, True, 200);
 header('Content-type: X-JSON');
 echo json_encode($m_Response);

 or

 header({$_SERVER['SERVER_PROTOCOL']} 200 OK, True, 200);
 header('Content-type: application/javascript');
 echo {$_POST['JSONP']}( . json_encode($m_Response) . '); //';

 for JSON/JSONP, then prototype will handle it correctly.

 But if you are NOT sending JSON encoded data, but straight HTML, then
 you use the text/html content type.

 So. When 

[Proto-Scripty] Re: Need clarification or guidance regarding arrays/hashes

2009-06-10 Thread david

Hi Luisgo,

I does the following test:

var test=$H({'1234':{},'12345':{}});
alert(test.inspect());
var myVar='123';
alert('string:'+Object.isString(myVar)+' / number:'+Object.isNumber
(myVar));
test.set(myVar,{});
alert(test.inspect());
myVar=1230;
alert('string:'+Object.isString(myVar)+' / number:'+Object.isNumber
(myVar));
test.set(myVar,{});
alert(test.inspect());
myVar=0456;
alert('string:'+Object.isString(myVar)+' / number:'+Object.isNumber
(myVar));
test.set(myVar,{});
alert(test.inspect());


And even if it's a number or a string, the input is well inserted in
the Hash.
I just have trouble in case the number the ID is a number beginning
with 0, it seems that it interpret strangly the value.

btw as you could see this code work (well !) in IE6 and FF3.0.
Your trouble is I think spmewhere else.

--
david

On 8 juin, 21:49, Luisgo lgo...@gmail.com wrote:
 I've been a long time user of prototype and feel very comfortable in
 most areas but this keeps coming up and I find it very annoying.

 I have a hash that, as the code executes is filled with numeric ID's
 as hash variable names. I basically need it to end up sort of like
 this:

     {
         '4567':{},
         '9546':{},
         '6497':{},
         ...
     }

 The problem is the IDs are passed as strings but casted as integers
 when I do:

     myHash.set( idPassedInVariable, {} );

 This causes the hash to be filled by undefined items where the
 missing numeric IDs would be. In the example above I would end up
 with 0 to 4566 being undefined and every space in between the rest of
 the keys.

 Am I doing something wrong? Isn't there a way to make set pass the
 string or is javascript simply going to force it to be a number?

 Thanks!
--~--~-~--~~~---~--~~
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: Need clarification or guidance regarding arrays/hashes

2009-06-10 Thread Richard Quadling

2009/6/8 Luisgo lgo...@gmail.com:

 I've been a long time user of prototype and feel very comfortable in
 most areas but this keeps coming up and I find it very annoying.

 I have a hash that, as the code executes is filled with numeric ID's
 as hash variable names. I basically need it to end up sort of like
 this:

    {
        '4567':{},
        '9546':{},
        '6497':{},
        ...
    }

 The problem is the IDs are passed as strings but casted as integers
 when I do:

    myHash.set( idPassedInVariable, {} );

 This causes the hash to be filled by undefined items where the
 missing numeric IDs would be. In the example above I would end up
 with 0 to 4566 being undefined and every space in between the rest of
 the keys.

 Am I doing something wrong? Isn't there a way to make set pass the
 string or is javascript simply going to force it to be a number?

 Thanks!

 


Using FireBug, I entered ...

var a = {'4':{}, '8':{}, '12':{} }

and then ...

console.dir(a)

and got ...


 console.dir(a)

4
Object
8
Object
12
Object


Which is exactly what I would expect.

What if you cast the value as a string?

 myHash.set( String(idPassedInVariable), {} );


-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

--~--~-~--~~~---~--~~
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: Need clarification or guidance regarding arrays/hashes

2009-06-10 Thread Richard Quadling

2009/6/10 david david.brill...@gmail.com:

 Hi Luisgo,

 I does the following test:

 var test=$H({'1234':{},'12345':{}});
 alert(test.inspect());
 var myVar='123';
 alert('string:'+Object.isString(myVar)+' / number:'+Object.isNumber
 (myVar));
 test.set(myVar,{});
 alert(test.inspect());
 myVar=1230;
 alert('string:'+Object.isString(myVar)+' / number:'+Object.isNumber
 (myVar));
 test.set(myVar,{});
 alert(test.inspect());
 myVar=0456;
 alert('string:'+Object.isString(myVar)+' / number:'+Object.isNumber
 (myVar));
 test.set(myVar,{});
 alert(test.inspect());


 And even if it's a number or a string, the input is well inserted in
 the Hash.
 I just have trouble in case the number the ID is a number beginning
 with 0, it seems that it interpret strangly the value.

 btw as you could see this code work (well !) in IE6 and FF3.0.
 Your trouble is I think spmewhere else.

 --
 david

 On 8 juin, 21:49, Luisgo lgo...@gmail.com wrote:
 I've been a long time user of prototype and feel very comfortable in
 most areas but this keeps coming up and I find it very annoying.

 I have a hash that, as the code executes is filled with numeric ID's
 as hash variable names. I basically need it to end up sort of like
 this:

     {
         '4567':{},
         '9546':{},
         '6497':{},
         ...
     }

 The problem is the IDs are passed as strings but casted as integers
 when I do:

     myHash.set( idPassedInVariable, {} );

 This causes the hash to be filled by undefined items where the
 missing numeric IDs would be. In the example above I would end up
 with 0 to 4566 being undefined and every space in between the rest of
 the keys.

 Am I doing something wrong? Isn't there a way to make set pass the
 string or is javascript simply going to force it to be a number?

 Thanks!
 


Numbers starting with a 0 are considered to be octal.

010 = 8
020 = 16
etc.

-- 
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!

--~--~-~--~~~---~--~~
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: z-index sortable list

2009-06-10 Thread Maya

I don't have much experience with this so I am having difficulty
figuring out how to set this up as per your first suggestion:

 To update the z-index after a change in the sortable, just use
 prototype DOM function like Element.firstDescendant() [1] and
 Element.next() [2] to update the DOM.
 When you set the z-index property, just use Element.setStyle
 ({zIndex:'100'}) [3].

Any suggestions?

Thanks so much!
--~--~-~--~~~---~--~~
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: how to check if a button is disabled?

2009-06-10 Thread Nathan

Ignore me I was having a brain lapse... fire bug lead me astray not
showing me the updated attributes when .disable() was applied .  a
quick test pointed me in the right direction.

 var ck = elm.getAttribute('disabled');  is true/false/null depending
on browser when set by .disable() which is what i was missing.




On Jun 10, 11:07 am, Nathan ykaerfl...@gmail.com wrote:
 It seemed like a simple question when I started, but for the life of
 me I have not found an answer yet.  So either I'm asking the wrong
 questions or going about this the wrong way.

 I have a button on a page which can or cannot be disabled ( via $
 (buttonID).disable()) I have another function which needs to know the
 state of that button.  How can I test if it was disabled using .disable
 ()?

 Thanks
--~--~-~--~~~---~--~~
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: Bizzarre goings on

2009-06-10 Thread disccomp

IE8 Developer Tools work great for finding these problems.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---