prototype

Jquery and Prototype Conflict

I am having trouble running two javascript files on the same page. I used JQuery.noConflict() (http://api.jquery.com/jQuery.noConflict/) but no luck. <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script> google.load("prototype", "1.6.0.3",{uncompressed:false}); google.load("scripta...

How to read and parse (local) XML-file in Prototype JS?

I have to create a module in a specific project, which already uses PrototypeJS. What I have: - An XML File with information What I want: - A simple div, which displays the (with XPath filterd) Content of the XML-File. I am complete new to PrototypeJS and dont know where to begin, so I appreciate your help. Blessing chris ...

Example from: "Javascript - The Good Parts"

What "ugliness" does the following solve? There's something I'm not getting, and I'd appreciate help understanding what it is. For example, by augmenting Function.prototype, we can make a method available to all functions: Function.prototype.method = function (name, func) { this.prototype[name] = func; return this; }; By...

finding specific immediate children of an element using prototype

Following DOM structure: <ul> <li class="item">yes</li> <li>no</li> <li class="item">yes</li> <li> <ul> <li class="item">no</li> </ul> </li> </ul> Assuming I have the outer <ul> in $ul. How do I get the two immediate children which have the item-class? In jQuery I would write something like this: $ul.children...

No warning from gcc when function definition in linked source different from function prototype in header

Hi, I had a problem with a part of my code, which after some iterations seemed to read NaN as value of a double of a struct. I think I found the error, but am still wondering why gcc (version 3.2.3 on a embedded Linux with busybox) did not warn me. Here are the important parts of the code: A c file and its header for functions to acqui...

Grails: JavaScript integration

I have grails server on http://mysite.com:8086/project/ ApiController renders some text(html code in my case) http://mysite.com:8086/project/api/lastorders I have another server http://othersite.net/ - this is simple apache server with HTML page. I want to show text returned from server on my page. I've tried: <script type="text...

update to prototype 1.6.1 causing Error code 12 with select() function

Ever since we upgraded to prototype 1.6.1, I have been getting errors when using the select function. the error is... An invalid or illegal string was specified" code: "12 It stops at line 3299 in prototype.js, which is: results = $A(root.querySelectorAll(e)).map(Element.extend); Example of my code where I call the function... variable...

parse chunked reply through ajax

Is there any way I can parse a chunked response through AJAX as the chunks are being received? For example, server.com/ping is set up so it sends a new chunk with some javascript in it, something like ping(), every 10 seconds which updates a number on the web page visible to the user. Is there a way to parse the individual "chunks" of i...

targeting the closest tag of a certain class rather than the first in prototype

I wrote a javascript function that uses the innerHtml of a named div (that occurs immediately after the script) for each row as output. the problem is, if I use $('divname'), it always finds the first instance, not the nearest. What's the simplest way in prototype to target the nearest "divname" div? eg (note, I'm using Grails, hence th...

Pass Element value to $ajax->link in cakephp

I need to pass the value of an element to an $ajax->link without using a form/submit structure. (because I have a dynamically set number of clickable links through which I am triggering the action) I used to do this in Ruby using the Prototype javascript function $F like this: <%= link_to_remote "#{item.to_s}", :url => { :action...

How does StreamHub do AJAX push through an iFrame?

Basically, how does this work: http://www.stream-hub.com/demo/RealTimeChart/index.html They are streaming JS through an iframe continuously and the browser window does NOT show the page as "loading". How did they do that? The streaming part is easy, but how do they prevent the browser window from being in a continuous "loading" state? ...

submit remote form with prototype

I have a remote form like this and a checkbox in it. When I select or deselect the checkbox I would like to set the value of a hidden field ajax submit this form to its designated url. I tried $('search_form').onsubmit(), but I get an error saying onsubmit is not a function. Using prototype. Whats the best way to do this? <form ons...

prototype to jquery, help please

Hello, I would ask for any user who knows how to program in jquery and prototype of a help to me in the following code in this prototype. function showPanelAds(){ $('ads').style.visibility="visible" } and function blog(id){ var ActionAjax = new Ajax.Updater( {success:'blogphere'}, '/inc/assistidos.asp', { met...

check all values match using prototype

Using prototype, is there a simple method of checking that a group of values match, for example - can this code be refined to a single line or something otherwise more elegant? var val = null; var fail = false; $('form').select('.class').each(function(e){ if(!val){ val = $F(e); }else{ if(val != $F(e)) fail = tru...

Are all of the default scripts loaded by Magento really needed?

Here's a listing of all the scripts loaded by Magento by default: ../js/prototype/prototype.js //prototype library ../js/prototype/validation.js //don't know what this does ../js/scriptaculous/builder.js //don't know what this does ../js/scriptaculous/effects.js //base scriptaculous effects library? ../js/scriptaculous/dragdrop.j...

observing multiple select menus with prototype

Hi, I want to observe multiple select menus and respond to their changes using prototype but only the first menu seems to be observed. This is my code: $('product_options').select('select').invoke("observe","change",optchange); If there are - for example - 3 selects within product_options then it only observes the first, i thought it...

Observing events on injected elements using prototype

I asked a question previously, it was answered correctly in the form i asked it but realised now why it wasnt working for me. i have this code to observe multiple select menus: $('product_options').select('select').invoke("observe","change",optchange); This does work - as pointed out - with static layout like this: <html> <head>...

Get table row based on radio button using prototype/javascript

I have an html table that has a name and a radio button like so: <table id="cars"> <thead> <tr> <th>Car Name</th> <th></th> </tr> </thead> <tbody> <tr> <td class="car">Ford Focus</td> <td><input type="radio" id="selectedCar" name="selectedCar" value="8398"></td> </tr> <tr> <td cl...

Ruby on Rails - jrails not site wide

Is it possible to configure jrails so that it only replaces the ruby on rails helper methods for some parts of the site? I am currently in a project where we are doing a staggered migration to jQuery so the site wide choice is not an option in this case. ...

Migrating from jQuery to Prototype

I'm starting to write code using Prototype coming from a jQuery background. Is there any chart that shows the prototype equivalent method to use in place of specific jQuery methods? More specifically, I'm looking for a $('#my-id').prepend('some stuff') equivalent in prototype? ...