File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Light-weight remote scripting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Light-weight remote scripting" Watch "Light-weight remote scripting" New topic
Author

Light-weight remote scripting

G Svensson
Greenhorn

Joined: Jul 26, 2009
Posts: 17
I need to make a web application with a light-weight remote scripting solution where images are to be loaded dynamically.

The user clicks on categories and new images will load, without having the whole web page reloaded on each click.

I'd like some guidance about best practices for a solution. I'd rather not use heavy frameworks (Ajax, scriptacolus, prototype, gwt) for this single task. But if it is necessary i need help in finding the most light-weight one.

I have tried Remote scripting with IFRAME but I have a hard time figuring out if that solution will be sufficient. Can anyone with more experience tell me if I will turn up in a dead end.

Please feel free to ask questions since I am not sure that I have provided you with enough details.

thnx

/surrven
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Ajax is not a "heavy-weight framework". It's not a framework at all; it's a methodology.

jQuery and Prototype are about as "light-weight" as they get (although there's also MooTools, which I'm not as familiar with) and a few others. Ajax is far and away your best solution--just do it, and use any reasonable JavaScript library. It will save you *huge* amounts of trouble.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Just to give you an idea...



#categoryList - your select element with list of categories.

#images - some sort of container (div maybe)

When you do a $.load() you would return the HTML that contains all your img elements referencing that category's images.

Another solution would be very similar except maybe you return some JSON or XML data of images and build the image list via javascript. Very lightweight as David says and not really a lot of code.


GenRocket - Experts at Building Test Data
G Svensson
Greenhorn

Joined: Jul 26, 2009
Posts: 17
Hi,

Thanks for the quick reply.
Do you have an example of a "reasonable JavaScript library". in this case?
I am very interested to learn new things but right now I need help to choose the solution that I do not have the time to first evaluate options.

Best regards,
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

G Svensson wrote:Hi,

Thanks for the quick reply.
Do you have an example of a "reasonable JavaScript library". in this case?


Um, did you see my example using jQuery?
G Svensson
Greenhorn

Joined: Jul 26, 2009
Posts: 17
Hi,

Yes I saw your example but by the context I didn't realize that it was jQuery. Nice. Thank you.
It will be very helpful.

My last question is about setting up an IDE for my project.
Suggestion:
- Eclipse, Aptana, Jaxter DWR

Will it be lots of unnecessary overhead? Can anything be replaced by a adequate product?

Best regards,

Surrven
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm confused, you ask about IDEs, but only one of the things you list is an IDE (Eclipse). Jaxer is a server, Aptana is a company with an RoR plugin.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

G Svensson wrote:Hi,

Yes I saw your example but by the context I didn't realize that it was jQuery. Nice. Thank you.
It will be very helpful.

My last question is about setting up an IDE for my project.
Suggestion:
- Eclipse, Aptana, Jaxter DWR

Will it be lots of unnecessary overhead? Can anything be replaced by a adequate product?

Best regards,

Surrven


Are you doing anything besides HTML and JavaScript? Are you planning on doing the server side work as well? What language (Java, PHP, .NET, Ruby, Python, etc) ?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
David Newton wrote: Aptana is a company with an RoR plugin.

And they have a IDE that is pretty nice for JavaScript.

Eric
G Svensson
Greenhorn

Joined: Jul 26, 2009
Posts: 17
Ok. you are right. Environment instead of IDE
I will be using Java.
Do yout think Aptana plugin be well suited for my project?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Heavens to Betsy, just try it. I think Eclipse's JavaScript support is poor, at least compared to IntelliJ, but I've never had to use a plugin just to write JavaScript.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

David Newton wrote:Heavens to Betsy,


You just aged yourself a bit there, David. ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Light-weight remote scripting