[Prototype-core] Re: $ function

2007-06-21 Thread Rebecca Blyth

I know I'm a little late on this one, but as the person who originally
filed the bug report, I thought I'd put in a word...

Personally, I'm happy with leaving the $() function untouched. People
who get caught out by it will now be able to see what the problem is
and what the workarounds are, and even have code they can use as a
wrapper if they want, thanks to the patch on Trac and the messages
here that include code.

Finally, an aside on not having control over the HTML source:
I ran into this issue when using the radio_button_tag helper method in
Rails, which inconveniently used the name of the input as the id -
unhelpful, as all the radio buttons in a group have the same name in
order to group them. This may be the sort of thing people are talking
about when they say they don't have control over the HTML source -
changing what your HTML generator outputs can be fiddly, if you've not
looked at how it works. Fiddling with rails was actually fairly easy,
but I've had to do similar things to another templating engine and
that was a lot harder!

Rebecca


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] bracket notation

2007-06-21 Thread sed

I've posted this question to ruby on rails, but figured people here
would be more likely to know the answer.

Using bracket notation in javascript seems to stop workiing when
prototype is included.

e.g. document.main[name].value. Is this a know issue? I know using $
('name').value is the best, but it would seem to be a bug for
prototype to break any existing javascript/dom object access methods.
Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: bracket notation

2007-06-21 Thread Mislav Marohnić
On 6/21/07, sed [EMAIL PROTECTED] wrote:


 I've posted this question to ruby on rails, but figured people here
 would be more likely to know the answer.

 Using bracket notation in javascript seems to stop workiing when
 prototype is included.


I'm not using the notation, but if Prototype breaks it it's a serious issue.

Can you pastie us a minimal document that demonstrates this?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: bracket notation

2007-06-21 Thread Ryan Johnson

This is very very unlikely. I use bracket notation with and without
prototype on many scripts that work cross browser. Check which other
libraries you are including, and make sure it is not a problem or
missing attribute of the object you are working with.

On Jun 21, 8:41 am, sed [EMAIL PROTECTED] wrote:
 I've posted this question to ruby on rails, but figured people here
 would be more likely to know the answer.

 Using bracket notation in javascript seems to stop workiing when
 prototype is included.

 e.g. document.main[name].value. Is this a know issue? I know using $
 ('name').value is the best, but it would seem to be a bug for
 prototype to break any existing javascript/dom object access methods.
 Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: bracket notation

2007-06-21 Thread sed

Interesting problem here and I don't think it's a prototype bug, but I
corrected the issue.
Here is what was happening if anyone's interested Here is a short
explanation:

Ajax Call generates some html into a div with this function inside:

GetNextField = function() {return('thenextfield');};

In an included .js file there is another function that goes like so:
function NextField()
{
  FieldName = new String(GetNextField());
  // then doing so breaks
  $(FieldName).focus() or document.main[FieldName].focus();
}

It's the 'new String' that's breaking it, but prior to adding
prototype and dumping all this into a layer with ajax it worked just
fine

The fix:
FieldName = GetNextField();
Bracket and prototype notation both work.

I'm not sure why this worked before, it must be related to the html/
script being generated into the div from the ajax.updater rather than
just being on the page.

Definitely not a prototype problem.

On Jun 21, 12:53 pm, Ryan Johnson [EMAIL PROTECTED] wrote:
 This is very very unlikely. I usebracketnotation with and without
 prototype on many scripts that work cross browser. Check which other
 libraries you are including, and make sure it is not a problem or
 missing attribute of the object you are working with.

 On Jun 21, 8:41 am, sed [EMAIL PROTECTED] wrote:



  I've posted this question to ruby on rails, but figured people here
  would be more likely to know the answer.

  Usingbracketnotation in javascript seems to stop workiing when
  prototype is included.

  e.g. document.main[name].value. Is this a know issue? I know using $
  ('name').value is the best, but it would seem to be a bug for
  prototype to break any existing javascript/dom object access methods.
  Thanks.- Hide quoted text -

 - Show quoted text -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---