Get Tutorial For Prototypes?
Mar 26, 2011Link me to a good guide or tutorial for prototypes?
View 6 RepliesLink me to a good guide or tutorial for prototypes?
View 6 RepliesI have been looking at Prototype.js quite a bit lately as I need to
create a very small library of similar functionality to a subset of
Prototype.js. This is for use with Ruby on Rails.
About Prototype.js Rob G wrote:
1. It modifies the protoype of some built-in objects so that
using say, for..in with an array object produces unexpected
results.
I can see that modifying the prototypes of Object or Array could break
other JavaScript libraries that depend on for..in. Prototype.js also
adds functions to the prototype of Element. How bad is that? (I notice
that in Flanagan's JavaScript 4th edition he mentions that you can
modify the prototypes of built in objects however there is no mention
of the dangers involved.)
I then thought I could use an instance of Element as the prototype of a
MyElement constructor but that option has been squashed in the past as
being not cross browser.
Assuming I shouldn't be playing with the prototypes of built-in
JavaScript objects I can see a couple options that might still be
available. Code:
In the spirit of the season, I wanted to make it snow on my website. So I began digging. Eventually I ended up with a script that moved an image element down the page in a snowflake-like manner. The problem with it was it was dependant on an img element for every flake - simply no poor programming when using an Object Oriented programming language.So I decided I wanted to extend (in Java-speak; most of my programming background is in Java) the in-built Image object. The new object's src variable will lead to an image of the type of flake it is. (I want to be able to have more variance in images than a simple dot.) The new object will have a function that will allow it to move.A separate,unrelated function will control when each flakes move.
I did some more research and read about prototyping on JavaScript Kit and here (http://mckoss.com/jscript/object.htm), but I still cant seem to get this to work. JS Lint says it's bug-free, but Firefox says "move()" is an invalid function. I am presuming the problem lies in my inability to fully grasp how to extend objects in JavaScript.
<html>
<head>
<script type="text/javascript">[code].....
I am using prototypes (library) ajax methods and one of them is properties. I am passing in the name value pairs:
var itemFilter = "MajorCat: Shoes",
parameters: { q : qry ,fq: itemFilter },
But when I request, it gives me this in the url: MajorCat%3AShoes That won't work, the search application on the backend doesn't filter properly because of the "%3A" instead of ":". When I manually pass in via the url: MajorCat: Shoes (at the end of the query) it works. So, that ":" is getting encoded. How do I get that IN the hash and make sure the request is unencoded when it goes out?
I'm thinking about developing a Google Maps style project for the university I work at. What I'd like to do is have a graphical image of our campus we currently use, but use AJAX to allow people to select a building and have the map dynamically move and point out the location.
The map is quite big so I was thinking of having it like Google Maps where you can drag the map through an iframe without having the page reload.
Does anyone know of some good tutorials on how to do this? While our campus is relatively large, it's not large enough to just use Google Maps instead of developing our own.
I am looking for some useful tutorial for AJAX. I did search on google, I got few but thought not enough or too basic. I am looking for some tutorials that are useful from your experience.
View 2 Replies View RelatedIs there a tutorial on dynamic SID generation?
View 15 Replies View RelatedI've made javascript tutorial for those who want to learn more
Here's the tutorial on my front page : [url] or direct link : [url]
Does anybody know of a good firefox extension tutorial?
Basically I have an XML list of things
<term>bleh</term>
<replacement>blehsky</replacement>
and I want to make the extension replace every occurance of bleh on the webpage with blehsky.
I can handle the javascript to do this, but I don't know where to start in making it into an extension.
I am a complete beginner to JavaScript (well I know this: document.write and alert) and I kneed a really good tutorial for beginners. Preferably free but I will pay up to �3 (not a lot I know but oh well)
View 1 Replies View RelatedI'm looking for a tut on how to create tabs for content, not tabs for navigation/menu. Yes, kinda confusing, but here's an example of what I'm after code...
If you scroll down mid way, you will see a tabbed area where it provides the options to check out: Photos, Location, Aeriel and Street View. This is what I want to mimic (not the tabbed navigation up top in the menu bar).
Can you recommend any tutorials that would teach me how to do this?
Can someone tell me how to learn JS? Can you recommend me some books or video tutorials? What is the best?
View 2 Replies View RelatedI'm not sure what the proper term is, so let me give you an example. Imagine visiting a web page and reading the following:
My Groups
Weather
Trivia
If you click "My Groups," an element pops open displaying a list of names. I'm not talking about a pop-up windows that you can move around. This is part of the page. It's invisible until someone clicks "My Groups."
If you click "Weather," another element opens, displaying information on the weather. Clicking "Trivia" opens a box with trivia questions.
I wonder if someone could point me to a good script or tutorial that explains how to do this. I think my preferred default setting would close all the other elements when you open a new element. For example, if you click "Weather," then the Weather box opens, but everything else closes.
However, it would be nice to have the flexibility to modify the open-shut mechanism.
I already have a script that does this, but it got mangled somehow. It requires an included JavaScript file and a style sheet working in tandem, and I haven't been able to recreate it. So I'd like to go back to square one and hopefully find an even better script - one that's a little more user friendly and/or versatile.
I am after a slide draw type menu system like this one and this one the second actually at moo tools themselves.
I have had a look a round and there doesnt seem to be any tutorials which tell you what to do, so i dont have a clue...
Moofx seem to have the scripts to download but give no indation how they work.
I want to make a dynamic 4 drop down menus with AJAX and PHP/mySQL, like this:
Category->dynamic subCategory
County->dynamic cityCounty
Is there any good tutorial that can teach me how to do this? I managed
to have that Category dynamicly loads subCategory and that County
dynamicly loads cityCounty but I ran into a problem when I already
picked subCategory and than went on to pick a County, because of the
reload.this function in javascript my subCategory gets lost. Can anyone
point me in right direction?
I'm trying out scripts previously made but with no luck. I cant get it to work.
Nothing to indepth. Nothing to fancy.
I just want a 4 image swap inside my div.
Can anyone guide me to a tutorial on how to build one?
Last year, just a few days before holidays, I wrote a tutorial about a new feature available in Firefox 3 that allows web developers to do AJAX-style file uploads. Initially I intended to publish this tutorial as a SitePoint article, but it got rejected so I published it on my blog.
Now, I'd love some feedback. So, if there's anyone out there that has enough patience to read an exhaustive tutorial about uploading files with nothing more than JavaScript I'd like to hear her/his opinion. If it's crap just tell me 'cause indifference kills. Anyway, if patience is not your strong point there's a ZIP package containing both a "simple" and a "complex" take on the problem. Try those.
I'm trying to find a tutorial or download of a horizontal accordion menu using Javascript / CSS. There are plenty of drop-downs but little-to-no horizontal versions.This is the kind of thing I'm after but aligned left rather than centred.
View 1 Replies View RelatedI was using this HTML5 mouseover tutorial, and realized it doesn't work in IE8. [URL]
View 2 Replies View RelatedMy application uses multiple lists in dynamic tables the contents of which change to reflext a user's context. I tried applying your tutorial code for assigning arrays to option values and text using the suggested pipe character "|" delimiter if one was used, but strangely in FireFox .search() to test for the presence of the pipe character returned 0 whether it was there or not! Using another character such as "#" worked fine. Also using DOM methods the text component had to be added by appending a TextNode otherwise the list simply displayed a list of 'undefined' items.My resulting function just unwraps an array of list items into an option group which is then appended to the select element at the calling end:[code]
View 1 Replies View RelatedI'm brand new to jQuery, and I am really interested in learning about it because of the potential it offers to enhance my webpages. To give you some background, I am self-taught in PHP and MySQL...not on a master's level, but I have designed and built database-driven sites with success and am confident that I can learn jQuery if only I could get pointed in the right direction. I have perused tutorials, links, forums and recently bought the jQuery Cookbook (I needed SOMETHING to go on and it was one of the few jQuery books at the local bookstore that felt as though it would be of help). My problem is, I am finding gaps in information that, to me, are critical to learning. I am looking for a nut-and-bolt approach, 'Do this, then do that' not the typical generalizations I keep encountering.
All I want to do to start with is to remotely validate a two-item form, you guessed it, username and email, against the contents of my database (the info for the validation plugins is just as vague and general). That's it. But the tutorials and examples are vague to me, and in one instance, a link was posted offering to display the server-side validation code used and the link was dead. I can't be the only person here who is stonewalled by these thoughtful, yet overly-general tutorials and books. if any of you have suggestions where I can find a concise, true step-by-step tutorial or book, I would love to know. Right now, it's just one frustrating day of research after another.
I'm looking for a tutorial type of help on using JQuery to create/populate a selection list. I've looked at their site (and searched on their site/google) and although there is tons of stuff there, I can't find what I need.
View 5 Replies View RelatedSorry but I can't get the very first tutorial to work. I put the custom.js in a test_jr directory in htdocs. I also put the starterkit.html file in the same directory. I copied the contents of jquery-1.4.4.min.js into a jquery.js file also in the same directory. Then I did the custom.js page shown here:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("a").click(function() {
[Code]...
I tried clicking on the [URL] and I get the starterkit.html page. If I click on the "some link" it doesn't do anything. What am I missing? There are syntax errors in my editor starting on the line with the asterisks* Why is there an error there? It looks like it closes the click function?