javascript

How to simulate JavaScript yield?

One of the new mechanisms available in JavaScript 1.7 is yield, useful for generators and iterators. This is currently supported in Mozilla browsers only (that I'm aware of). What are some of the ways to simulate this behavior in browsers where it is not available? ...

Javascript select elements

How can I select all of the check boxes from a table column by knowing the column index? LE: This needs to be addressed in plain javascript, not jquery ...

Javascript: How can I execute code on a function call without overwriting that function?

So, I would like to have some code executed everytime a given function is called, is that doable? Thing is, I could just overwrite the existing function and add the code, but that would require me to know the exact content of that function... Imagine a "plug-in" to a "library", and you want the plug-in to execute code everytime a specifi...

Given a .SQL file on an internal website, what options are there for pretty formatting on the fly?

So I want to put the files up on my local server, for reference purposes and aside from my regular DVCS because this will turn into training material later. But I want to be able to pretty format the SQL file. (Would be nice if it extended to C# code as well.) I'm not sure what libraries do this already, and I'm willing to bet there's a...

JQuery - disable inputs that haven't been added yet

I want to disable inputs with a particular class, however I want to do this for any future inputs added to the page. live() and delegate() can bind to events on elements that don't exist yet. Is there some sort of selector that can run some code on future elements in the same way? ...

Check if opacity is set

Hi there. I have a script that animates opacity but if the opacity has not been previously set then it just disappears. I just wondered if there was a way to check if the opacity has been set. Thanks in advance! ...

Changing Input Fields Html / JavaScript ?

Hey, I have these input fields, well 1 input text box, and then i have a drop down. Now what I want is when a user selects an option from the dropdown (this is the dropdown) <select name="searchType"> <option value="all">All</option> <option value="music">Music</option> <option value="movie">Movies</option> <option value="...

How do you work with long variables in Javascript?

Hi, How do you recommend to work with long variables in Javascript? Thanks! For example... window.location.hash.substring(2).split("/")[0].something().hello; object["object"].object(object.hello.how.are.you[another.object(function.inisde())]); My solutions Use with() { (...) } ...

Javascript maturity on Blackberry, Android, Windows Phone 7 and iPhone

What is the state of maturity of javascript on these platforms? Is safe write a prototype app and trust that it'll work on all of these devices without headaches? ...

Why does Firefox sometimes generate "console not defined" error?

Sometimes Firefox generates console not defined error when console.debug() is used. Is this some kind of timing issue with load? ...

Does this behavior of setInterval imply multithreading behavior in Javascript?

Hello people. In using javascript i noticed this thing. You can use var i=0; var startingTime=new Date().getTime(); setInterval("foo()",1); function foo() { i+=1; if ($("#foodiv").text()==i) { //we detected a doubled value (parallel execution) $("#repdiv").append("[repetition on "+i+"]"); } $("#foodiv")....

Build an application

I want to build a application in codeignitor. Anybody, have any good ideas for something for me to build? ...

Large 5000 cell Grid using css, javascript and xhtml

Hi I need to create a large grid with approx. 5,000 cells (10x10px). each cell needs its own ID, has to be clickable. cells that have been clicked need to be shaded differently. I also have to have a background image which needs to remain visible. This is wrecking my head as the HTML overhead creating 5000 div tags is simply too much. ...

Overriding Drupal javascript behaviors.

I want to override a bit of core drupal behavior on the comment form. If you make a comment as an anonymous user, your name and mail are stored in a cookie, and then javascript fills out the appropriate fields in subsequent comment forms using this code below: Drupal.behaviors.comment = function (context) { var parts = new Array("na...

ExtJS vs. jQueryUI

I recently had the experience of doing the same thing (a search combo box) with jquery and extjs. I found extjs to be buggy and overly complex. On the contrary, I found jquery to work very well and be very simple. I am wondering what are other people's experiences of using extjs. Does extjs complexity actually buy you something? ...

Connection Issue while using Jasmine Javascript Testing Framework

I am having an issue using Jasmine on Ubuntu when trying to run the example javascript specs through Selenium using the "rake jasmine:ci" command. I will periodically get a "Connection refused" error when net/http is trying to connect to the port where Selenium is running. An example the start of the backtrace I get is: Waiting for jasm...

javascript / jQuery / CSS - vertical text ?

Hi how can I make text draw vertically, like in this site: http://cure.org/help-now/ ? I see that it's done with jQuery + SlideDeck because I see them loaded, but how exactly does the plugin do this? Firefox has css -moz-transform, but other browsers don't have such properties, and the vertical text from that site shows in all browsers...

Is it essential to use a developer key in Google Jsapi calls?

I've been using Google Jsapi like so: <script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script type="text/javascript"> google.load("jquery", "1.3"); </script> But the Google docs recommend doing this: <script type="text/javascript" src="http://www.google.com/jsapi?key=YOUR_KEY_HERE"&gt;&lt;/scri...

jQuery collapsing list?

Check out http://jqueryui.com/demos/draggable/ At the bottom there's a tabbed section... the seconds tabs "Details" gives the example of exactly what I want to accomplish. You can show/hide each row, and you can show/hide the details within that list row. Is this part of the jQuery UI? If so, does anyone happen to know what it's called...

jQuery: How to manipulate the contents of an iframe when the src is a different domain?

I have an iframe loading a page, and I would like to manipulate the contents. For example: <iframe id="myIframe" src="http://www.google.com"&gt;&lt;/iframe&gt; <script> $(document).ready(function(){ $(iframeContents).css('background-color', '#000'); }); </script> How can I do this? ...