prototype

Passing a form object to a partial rendered from an ajax request

I have an event form with some nested attribute models. The additional models are rendered after a client is selected from a select box. An observer watches and calls a controller action which renders a partial containing the fields_for nested models. The issue I'm having is that I can't pass the event 'form' block to the newly rendered ...

How to use $ for jQuery inside domready when prototype is using $ outside?

I'm unable to remove prototype from a JSF framework (RichFaces 3.3.3). And if I try noConflict and try to take over $ it breaks my application framework because its tightly coupled with prototype. So is there a way that I can do this: jQuery(function() { /* some code that within this domready function allows me to ...

Hack Javascript Definitions for "undefined" objects.

Hey, so I'm not entirely sure this is possible, but I am curious if it is possible to hack the definitions of "undefined" objects. Primarily, the purpose of this is to prevent errors from launching when doing a .replace on an object that is undefined. Is it possible to go into the "back end" (is there even such a thing??) and add a met...

How do I make my div IDs variable in rails?

I feel like there should be a simple way to do this, but I just don't know what it is. I have a list of data to display, and I want to include an AJAX "Read More" function to expand information at the bottom of each segment. To do this, I need unique div IDs within each segment. I have this code: <% for choice in @student_choices %> ...

Converting String to DOM.

My Ajax functions gives me HTML-Elements as String back, and this String I want to append in my Document as DOM Element. Something like parentNode.appendChild(responseText); What will be the best way to do this. ...

Highlight text diff on client?

I want to compare 2 text values on a web page and highlight the differences. Can I do this client-side, preferably with jQuery or Prototype? ...

How can I find the memory leak in my Javascript?

I have an application that displays tables of data, in a paged format. Clicking on a "page" button re-renders the table. (These are not HTML pages - these are just buttons that re-populate my table with a new "page" of data) Each table cell has event handlers attached to it. For all intents and purposes, if the application starts on "Pa...

Event 'Window load' not work in opera with prototype

I use prototype ver 1.6.0.2 Event.observer(window,'load',function(){ function1();// function with ajax request function2();//another function with ajax request }); It work on FireFox,Chrome but in Opera it work strange Func2 and fucnc2 not runing but if page scroll down it runing both function immediately Plz help. Thanks. ...

file upload using ajax

I am looking for a ajax method that can be used to file upload. It will be super if I find a funtion that uses Prototype + Script.acul.us ...

My web app non-deterministically crashes in Google Chrome

In my web app, I use Ctrl + Arrow keys to navigate from cell to cell in a table. All cells contain a visible <span>, and a hidden <input> element -- their values are kept in sync. When a cell is activated, the <span> is hidden, while the input is shown. Everything works just fine in Firefox, IE, Opera, etc. Yet, when I load up Chrome,...

Magento: Show the Review Step in One Page Checkout

I have not been able to figure this out for the life of me. I wanted to show the order review step(final step before processing the order) right away on the one page checkout in Magento. Any suggestions? Thanks all. ...

Strange behaviour in Google Chrome with Prototype Library

Hi I used the Prototype library in an app mostly because its "cross-browsers" features. My fear was that everything would work fine in Firefox but crashed on IE. But for my surprise, this line of code crash (and in a very disgusting way) on Google Chrome: $('mensajes').update(""); With the message: "TypeError: Cannot set property ...

Rails 3 UJS driver events

Hi, According to Simone Carletti blog post, Rails 3 ajax helpers have changed a lot. We are supposed to write more javascript with rails 3 than we used to with rails 2. I tried to figure out how to show up an ajax loading gif -while an ajax query is running- in the "rails 3 way". I came up with this kind of code, which uses javascript ...

Javascript - Prototype: Event.observe on a form is not working for IE

I have this JS which gets a XML response from a service, its a True or a False, well the script should catch the submit and get the response from the service. The problem is that I see that its not working because when I do the submit, I see the XML response on IE (6/7/8), when the script should have catched it and validated the XML resp...

Prototype - click event by element class name

I am new to the prototype framework and am trying something really simple and failing. I am trying to respond to a click event on a button like so: $$('.btn').observe('click', respond); function respond(event) { alert("hello"); } Why isnt this working?? Please help! ...

C# 2010 compile XNA class at runtime

I'm wondering how to compile and run a XNA class from an interaction on a C# Window Form. For example, when I click button "Play" from a C# Window Form, the game which is built in XNA classes will be compiled and run. Hope my question is clear enough. Any helps are appreciated :) Thanks in advance ...

jquery,prototype,mootools altogether in magento

Hi, I have got a template which is really nice with great Ui. But they used jquery and mootools without any prob. And now i incorporate that one with magento but i have the prob with prototype. Is it possible to use all these libraries together. Please help me. And one query with stackoverflow : here i had more than 110 reputation but ...

Problem with Prototype Ajax.Request in Internet Explorer 8 prompting file download

Have a set of prototype-enabled ajax code that is working in all browsers other than IE. In IE8 the JSON, that otherwise gets returned to the onSuccess handler function specified in Ajax.Request, gets thrown into a file download stream which pops up and prompts for where to download. askForm = $('askForm'); var askUrl = '.'; var askPar...

Help changing function from prototype to jQuery!

Hey I found this function online and it works fine if I use it by itself, but the rest of my document has all jQuery functions and I'd like this one to be in jQuery as well. I also get a few errors when mixing prototype and jQuery. Here is the function: function updateCommodityProduct(e) { // The response comes back as a bunch-o-J...

How to get elements with an ID containing certain text? (Prototype)

I have a set of 3 radio buttons, with these element IDs: id='details_first' id='details_second' id='details_third' How do I get all the elements whose id starts with 'details_' ? EDIT What I'm actually trying to do is this: Each radio button has an associated div that I want to display when the radio button is clicked. At one time o...