This is a migrated thread and some comments may be shown as answers.

Not quite right?

1 Answer 25 Views
Refactorings
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 25 Apr 2010, 08:04 PM
I discovered this on one of my first ventures in to refactoring JS code ...

Before ...
        <script type="text/javascript"
          function xx() { 
            // Blah, doing stuff 
            var szp = $find("<%= RadPane1.ClientID %>"); 
            szp.expand(); 
            // more stuff 
          } 
        </script> 

After using JC's "Extract Method" ...
        <script type="text/javascript"
          function xx() { 
            // Blah, doing stuff 
            NewMethod($find); 
            // more stuff 
          } 
          function NewMethod($find) 
          { 
            var szp = $find("<%= RadPane1.ClientID %>"); 
            szp.expand(); 
          } 
        </script> 

That's not right, is it?

-- 
Stuart

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 28 Apr 2010, 09:55 AM
Hello Stuart,

Thanks for bringing that to our attention. Seems that JustCode does not recognize ASP.NET AJAX shortcut functions like $find(), $get(), etc. and is treating them as local variables. I've created a PITS issue for that (ID#1972), from which you can follow its progress.

Greetings,
Kaloyan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Refactorings
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Kaloyan
Telerik team
Share this question
or