javascript

Mootools - get form's first input, select etc item

Hi I need to get the first element from a form, could be a select, text, radio etc. I can get all the elements using the following: $('myformcontainer').getElement('form').getElements('select,input[type=text]'); And this returns all my form elements, however the problem is that the items are organised by tag type (in this example; se...

Speed performance: Reduce HTTP requests or not?

Hi everybody, A theoretical question: We all know about the pro's of minifying and combining javascript files in order to reduce HTTP requests to speed up a website. But when popular javascript libraries is used (jQuery for instance), it isn't too stupid to assume that these already have been downloaded to the clients computer from anot...

HTML/JS open a window to the C$ drive

Hi, I need to have a link in my application that opens a remote C drive window to a certain machine. For example, this works... <a href='\\dev_pc101" />\C$'>Connect to C</a> BUT... I need to do it from a piece of JS code. so I'd like to do something like this.... function raiseQueryDialogConfirmRemoteDrive(arg) { if (arg == 'butt...

with #hash_id concatenated with url, document.getElementById(hash_id) cannot be traced

with #hash_id concatenated with url, document.getElementById(hash_id) cannot be traced onclick. But after refreshing it is working fine for example, http://myurl.com/#123 can not identify specific id using document.getElementById(hash_id). until refreshing again ...

Will this actually reload images?

I've written this simple image preloader based on my knowledge of javascript, but I don't know if it will actually load the images before the page is displayed or if it will still load the images. function preloadImages(html) { for(var i=0;i<document.images.length;i++) { img_obj = new Image(); img_obj.src = document.images...

Creating <td> elements with customer behavior on the fly in jQuery

Just getting started with jQuery, and I've had some success so far. I've created a handler that updates a <table> every time a user makes a selection from a dropdown. It looks mostly like this: function loadAttributes() { $.ajax({ type: "POST", url: "../ws/itemSearch/getAttributesForItemType", contentType: 'application/xml',...

Prototypes cumulativeOffset().top Google Chrome bug

For example if I go to a page $('element').cumulativeOffset().top returns 400 if I refresh this page it retrns 100 for the same element, only in chrome. Any idea how to solve this? ...

Can I use a loop to execute the same function call multiple times on incrementing element Id's?

Right now I have 2 functions called showElement (elementId) and hideElement (elementId). I use these to hide and display rows in a table based on what a user clicks. I have a submit button for an area that takes in about 30 rows and looks like the following function hideGeneralSection { hideElement('gen1'); hideElement('gen2'); hideElem...

Best book(s) about web design and front end development

I searched for a while but I couldn't find a question that exactly covered this topic. I'm looking for a web design book that covers both the design part and the front-end development part. What I mean by that is a book that teaches me about UI, color theory, typography, use of illustrations, etc (the design part) and also how best to wo...

Getting Eclipse Helios Javascript working

I've just downloaded Eclipse IDE for JavaScript Web Developers and can't figure out how to run or debug a standalone javascript program using it. Presumably I have to set up a server of some kind? Any idea where the documenation might be? ...

Add form element functionality to contenteditable div

Hello all, I use the MooTools Javascript library. And this library give a couple of really useful functions here: http://mootools.net/docs/more/Element/Element.Forms The problem is that this functions only work for 'form' elements like textarea, etc. Now i am making a online editor and for the editor it self i use a div element and th...

Why are some PHP email bodies containing the surrounding html code and other are not? And that is not PHPMailer

I have various emails being sent out via PHP mail. The problem is, for example when I receive the email, it is displayed in the body properly without any surrounding html. For some reason, other people that I am testing it out with are getting it with the html showing up. Here is an example of one of the emails being sent: $Em...

Google maps api Circle gradient?

I am adding circle overlays to my map. I can now properly set the color, opacity etc. How would I achieve a color gradient (i.e. radially out from the center)? Is this even possible? (I am using api v3, but if you have a solution with v2 I would love to see it too). ...

Stringify JS Object to JSON (Have Functions stringify into a property)

Is there a function or library that will take a JS Object that has properties and functions and stringify it to JSON but when it comes to a Function, it will change it into a property and call the function to return its value?? function object() { this.property = 12; this.function = function() { return "This"; } } So this wou...

Multiple upload in Gecko/WebKit: allow removal from list before upload

I'm trying to use the new multiple="multiple" attribute allowable on elements. So far this is supported by recent Gecko and WebKit browsers. I'm testing on Firefox 3.6 and Chrome 5.0. I'm able to use it fine, and display the list of files (I used this as guidance). Rather frustratingly, however, it seems like it's impossible for the us...

Prototype + Flickr Ajax Request doesn't work with Firefox

Hi every one I have a weird issue I been working with the Flickr API, in Flickr for make a connection with the server is through url format in my case something like this http://api.flickr.com/services/rest/?method=flickr.photosets.getList&amp;api_key=10cb3dccaa050efebdc01540c1d4d227&amp;user_id=51390557@N07&amp;format=json If your r...

How can I add an (otherwise) invalid HTML element into TinyMCE.

My HTML contains elements like this, because it uses inlines from django-basic-apps. <inline type="myapp.mymodel" id="4" /> I'm trying to use tinymce to insert one of these into the DOM. On the frontend of the site, these are processed into good code. In tinyMCE I've added the config: extend_valid_elements: 'inline[id|ids|type|filte...

JavaScript "Toaster Popup" class works awesome in FireFox fails in IE...

SOLVED: SEE "CORRECTED SOLUTION" Area (below) --------------------------------- ORIGINAL TEXT --------------------------- I've created a JavaScript toaster popup to show info about an individual row. It works great in FireFox...but it goes down in flames in IE. ...suggestions and help appreciated. WHAT I THINK IS FAILING: I think I ...

How can I define a default getter and setter using ECMAScript 5?

How can I specify a default getter for a prototype? With default getter I mean a function that is called if obj.undefinedProperty123 is called. I tried Object.prototype.get = function(property) {..} but this is not called in this case. ...

Adding a series to a simple dojo chart

I have constructed a simple function that programatically builds charts using dojox.charting. I'm a bit puzzled as to how to cast variables correctly when passing them to the chart via addSeries. Consider this: function buildChart(targetDiv){ //grab the destination var bc = dojo.byId(targetDiv); //define the da...