prototype

Script.aculo.us Autocompleter problem in IE

I'm struggling with a problem with the Script.aculo.us Autocompleter control in IE (I've tried it in IE6 & 7). The suggestions fail to appear for the first character is entered into the text box after the page has been loaded. After that initial failure, the control works as it should. I've verified that the suggestions data is returned...

Replace text inside a DIV element

I need to set the text within a DIV element dynamically. What is the best, browser safe approach? I have prototypejs and scriptaculous available. <div id="panel"> <div id="field_name">TEXT GOES HERE</div> </div> Here's what the function will look like: function showPanel(fieldName) { var fieldNameElement = document.getElementById...

How do I add a <table> using Element with Prototype in IE6?

Using Prototype 1.6's "new Element(...)" I am trying to create a <table> element with both a <thead> and <tbody> but nothing happens in IE6. var tableProto = new Element('table').update('<thead><tr><th>Situation Task</th><th>Action</th><th>Result</th></tr></thead><tbody><tr><td>a</td><td>b</td><td>c</td></tr></tbody>'); I'm then tryin...

jQuery & Prototype Conflict

Hi, I am using the jQuery AutoComplete plugin in an html page where I also have an accordion menu which uses prototype. They both work perfectly separately but when I tried to implement both components in a single page I get an error that I have not been able to understand. uncaught exception: [Exception... "Component returned failure...

How can I design an ASP.NET website delaying the style/theme?

I need to build a prototype for an intranet website, and I want to focus on usability (layout, navigability, etc) and leave the theme for later (I have very bad taste, so this will probably be done by someone else) I know about ASP.NET's capability of switching themes instantly, but how do I have to design the WebForms for it to be easy...

Testing the type of a DOM element in Javascript

Is there a way to test the type of an element in JavaScript? The answer may or may not require the prototype library, however the following setup does make use of the library. function(event) { var element = event.element(); // if element is and anchor ... // if element is a td ... } ...

What does it mean that Javascript is a prototype based language?

One of the major advantages with Javascript is said to be that it is a prototype based language. But what does it mean that Javascript is prototype based and why is that an advantage? ...

Wanted: acts_as_nested_set, AJAX drag and drop tutorial

Can anyone suggest a tutorial or sample code that implements a nested set (or similar ordered tree structure) with associated Javascript that facilitates drag and drop? I'm looking for both the display code (view) as well as the AJAX backend controller which writes the tree to the database on change. I want it to represent a multi-layer...

which scope should a DAO typically have.

its out of question that a dao will not hold any state. however, for easiest access to the class, is it better to use prototype( = new every time) or singleton? simple object creation is cheap for dao's.. it typically only holds a sessionfactory, accessing the object from a list of singletons may be equally expensive. clarfication: t...

Browser & version in prototype library?

I am used to using Atlas. Recently i have started transitioning to jQuery and sometimes prototype. The project that i'm currently working on is using prototype. In Prototype, is there an easy way to get the browser name and version? I've looked over the API documentation and can't seem to find it. ...

Problem with Prototype's AJAX.Request function.

I'm trying to create a POST request, unfortunately the body of the POST never seems to be sent. Below is the code that I'm using. The code is invoked when a user clicks on a link, not a form "submit" button. It runs without error, invokes the servlet that is being called but, as I mentioned earlier, the body of the POST never seems to...

Ajax GET requests: use parameters or put data in URL?

What's the advantage of passing data as parameters vs part of the URL in an Ajax GET request? Using parameters: var ajax = new Ajax.Request('server.php',{ parameters: 'store=11200&product=Meat', onSuccess: function(myData){whatever} }); Using URL: var ajax = new Ajax.Request('server.php?store=11200&product=Meat',{ onSucc...

RJS/Javascript conventions in rails

I'm starting to look into the whole world of RJS and Prototype/jQuery in rails and am a little bit confused. There seems to be no clear line of where to use one or the other. Say i wanted one of the "Active, Hot, Week" tabs like the ones here on SO. When pressing one of them i want to remove a css class (like "active-tab") from the one ...

Best way to implement .lastChild using Prototype or jQuery

Currently we are using prototype and jQuery as our js frameworks. Right now, jQuery is set to $j() to prevent conflicts from prototype. In the past, we've used a lot of prototype's Element.down(), Element.next(), and Element.previous() to traverse the DOM. However, I need a simple way to retrieve the last child element. I know i can loo...

How does Yegge's prototype pattern example handle instance variables?

I like Steve Yegge's Prototype Pattern example and decided to whip up a quick proof of concept example. However, I didn't really think things through. While it is great for dynamically specifying the behaviour of objects and is an easy solution to Steve's opinionated elf example, I'm still trying to work out the best way to handle inst...

Problem with Ajax.Request using JSon and Prototype

I am using the following function to load a PlayList of Songs from 'PlayListJSON.aspx' but somethings seems wrong,evrytime OnFailure is getting called, I am unable to debug it further. any help would be really gr8. Player.prototype.loadPlaylist = function (playlistId, play) { req = new Ajax.Request('/PlaylistJSON.aspx?id='...

Looking for a good treeview widget for Scriptaculous

Is anyone using a good Treeview widget for Prototype or Scriptaculous? If so, why did you choose this one? It has to support dynamically generated data, and drag'n'drop. Note: I found TafelTree, which looks nice. Anyone has worked with it? Thanks! ...

Ajax using Prototype.js in OFBiz

I need to make an Ajax call inside OFBiz framework using prototype.js. I am doing that from a ftl file. I am confused of how to handle the server side - through java event or java service. What is the best practice? And also i am having problem making the framework recognize prototype.js file. There is some issue with the path name in t...

Make a scrollable element stay "at the bottom" while adding content.

I am building a utility page for a web app that I am working on. I have an element that I want to use as a "console" of sorts. I get entries for the console via Ajax calls (using prototype's Ajax.PeriodicalUpdater). The problem I'm having is that when I insert new lines to the bottom of the "console", the scrollbar stays in the initi...

Is there a resource to help convert Prototype JavaScript to jQuery?

I have extensively used Prototype before and it helped us add considerable interactivity to our web applications. However we are looking at making the move to use jQuery in order to standardize on something better supported in Visual Studio. I understand that we can use the jQuery.noConflict to run it alongside Prototype, but we would l...