prototype

How to show a Lightbox dialog from an ASP.NET AJAX response.

I want to use Thickbox (or one of the varieties) on our site to display information messages returned from the server. Examples include warning messages returned from biz logic, etc. The first place to need this functionality will be the navigation buttons on an asp:wizard control. When the user tries to move forward, we validate thei...

jQuery: "this.cloneNode is not a function" when included on a page with Prototype

Hi All, I'm trying to use jQuery in a bookmarklet, which means I don't have control of the page into which the JavaScript will be inserted. From what I've read of noConflict, it requires that jQuery be inserted first. In the case of a bookmarklet, just the opposite is true. So - does anyone have any suggestions on whether or not this...

How to make Struts and Prototype work better together?

Prototype library uses $('element-id') or $F('element-id') to get the element or value of a form element. This is very convenient to code in javascript. But in Struts, I find there is no way to define an id attribute for a form element. Although i can use <html:xhtml/> to define a form tag with id attribute as follows: <%@ page co...

Javascript on page is not executing before AJAX onComplete event is called

I have a form that makes an Ajax POST request to insert a widget into my database. In the form, I have a select box where you can select from the widgets. After the db insert is made, I must update the select box. I actually just replace the entire form for now. Because the select box has the widgets, I must have a copy of the obje...

What jQuery annoyances should I be aware of as a Prototype user?

We're considering switching our site from Prototype to jQuery. Being all-too-familiar with Prototype, I'm well aware of the things about Prototype that I find limiting or annoying. My question for jQuery users is: After working with jQuery for a while, what do you find frustrating? Are there things about jQuery that make you think abou...

A simple yet powerful web site map design tool?

I just need to draw a sitemap as a document. Visio conceptual sitemap is an overkill and not friendly. I havent tried COnceptdraw. What I am looking for is a simple lite tool. Good if I can make a flash or exe export so that I can send it to the client. ...

Prototype plugin for dynamically expanding textarea

Does anyone know of a good plugin for prototype which allows textareas to automatically expand / contract based on how much text there is in them (e.g. a line is added the area gets bigger, a line is removed it gets smaller)? I need one thats free to use (e.g. some form of GPL type license). ...

What is the problem with this ajax(with prototype)?

Hello i have the next code: php side: <?php print_r($_POST); print_r($_GET); die(); ?> In javascript: voteAjax = function(typez, actionz, idz){ new Ajax.Request( 'http://localhost/reporeade/Vote/Ajax/?rand='+Math.random()*500000, {asynchronous:true, evalScripts:true, method:'post', par...

How to disable AJAX-y links before page Javascript ready to handle them?

I am implementing a shopping cart for my website, using a pseudo-AJAX Lightbox-esque effect. (It doesn't actually call the server between requests -- everything is just Prototype magic to update the displayed values.) There is also semi-graceful fallback behavior for users without Javascript: if they click add to cart they get taken to...

prototype and constructor object properties

I've: function Obj1(param) { this.test1 = param || 1; } function Obj2(param, par) { this.test2 = param; } now when I do: Obj2.prototype = new Obj1(44); var obj = new Obj2(55); alert(obj.constructor) I have: function Obj1(param) { this.test1 = param || 1; } but the constructor function has been Obj2... why that? O...

Best technique for DHTML windows/dialogs in Prototype?

I love Prototype but it doesn't come with any widgets. In particular, it provides nothing for window/dialog creation. I've tried the Prototype Window add-on library but found it unreliable and it hasn't been maintained for a long time. Anyone have any recommended solutions? Or any recipes/patterns for creating a dialog from first princ...

get one Attribute id, set as another Attribute id

I'm currently using scriptaculous and prototype to drag/drop elements from one div to another, and append a new Element based on the 'src' of the element that is dropped, creating a new draggable out of it. What I need to do is assign the id of the dropped element to the new one once it is created. I've tried a ton of different approac...

How To Elegantly Handle JSON Objects in Responses From Ajax Requests?

I'm really new to using JSON to handle my Ajax Request and Response cycle. I've previously used just plain old parameters passed as POST data and I've rendered straight HTML in the response which was then placed into the DOM. As I've looked at various examples and read through various tutorials, it seems like a fairly common practice to ...

prototype javascript calendar with customizable rendering of cells like YUI Calendar

I already make extensive use of prototype and don't want to add an extra framework like YUI. I need a javascript calendar which enables me to customize rendering of calendar-cells on a cell by cell basis. (For rendering events, prices, etc. on a certain date) . YUI Calendar makes this possible, but I already make extensive use of pro...

How can I highlight a subset of the text in an input box?

I'm trying to figure out if it's possible using Javascript to highlight a specific range of data in a text field. textfield.select(); That ^^ works to select the entire text, but for all my googling I haven't stumbled upon a way to select, for example, characters 2 through 10 of the entered text. Is this possible? Thanks! ...

Calling base method using javascript prototype

Is it possible to call the base method from a prototype method in javascript if it's been overridden? MyClass = function(name){ this.name = name; this.do = function(){ //do somthing }; }; MyClass.prototype.do = function(){ if (this.name === 'something'){ //do something new }else{ //CALL BASE METH...

Read a specific table column with Prototype

Hi, I need to read all the values of the first column of an HTML table, and I don't want to use DOM methods. I'd like a simpler solution using Prototype or YUI. Note: the table is generated by a grid widget provided by an external team. That's why we cannot be sure of which IDs or Classnames are used. In short I'd like something lik...

ActionScript problem with prototype and static type variables

I'm developing a flash (Flash 9, AS3) to connect to a server and send/receive/parse data to a chat on JavaScript/HTML. I have a structure like this: package { public class myClass { String.prototype.escapeHtml = function() { var str = this.replace(/&/g, "&amp;"); str = str.replace(/</g, "&lt;"); str = str.repl...

converting from prototype to jquery

I'm trying to do a simple ajax update of a div from a php file that gets data from a mysql database. One function populates the div, the other adds messages to the database and is called on click of a submit button. I was wondering if someone could give me their equivalents in jquery. Below are the prototype versions. <script> function...

Javascript - How to extend Array.prototype.push()?

I'm trying to extend the Array.push method so that using push will trigger a callback method, then perform the normal array function. I'm not quite sure how to do this, but here's some code I've been playing with unsuccessfully. arr = []; arr.push = function(data){ //callback method goes here this = Array.push(data); return this.l...