num = num || $F('refid');
I didn't get that .
Is it like this --> num = $F('refid');
On Feb 16, 5:03 pm, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
> Hey Pankaj,
>
> Pankaj a écrit :
>
> > function getHTML(num) {
> > var num;
> > if(!num) {
> > num = document.getElementById('refid').value;
> > } else {
> > num = num;
> > }
>
> OK, so you hide your argument with a local variable... Nice.
> I bet this whole beginning of code would better of like this:
>
> num = num || $F('refid');
>
> 'Looks more Prototypish, too.
>
> > var pars = 'num='+num+'&showallfiles='+saf
> > +'&act=showattachedfilesection';
>
> This sounds okay, although as a matter of taste I prefer to let
> Prototype encode this thing and describe parameters as an object-as-hash:
>
> var pars = { num: num, showallfiles: saf,
> act: 'showattachedfilesection' };
>
> > var myAjax = new Ajax.Updater( {success: 'placeholder'}, url,
> > {method: 'get', parameters: pars, onFailure: reportError });
> > }
>
> 'Look okay to me (although why you store the result in a variable I
> can't fathom).
>
> > The above code works fine in Firefox but not in IE.
>
> I think it's this argument hiding I mentioned. If my replacement
> doesn't work still, please describe the issue better (what happens in
> IE?), or better yet: put a reproducible case online.
>
> 'HTH
>
> --
> Christophe Porteneuve aka TDD
> [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---