javascript

Embedding Facebook Connect In A Facebook Page

Our site allows users to register using Facebook Connect. We also have a Facebook page. We'd like to include the "Connect with Facebook" button in our page so a user could instantly connect (aka register) and then be forwarded on to their account on our site. I was hoping to use the Static FBML page application and the FBML iFrame tag ...

How can I determine the instant a function is loaded?

I am using the Google Maps JavaScript v3 API. The maps library takes awhile to load; however, certain functions load before others. How can I programatically determine the instant the getBounds function is ready for use from the Google Maps JavaScript library? UPDATE: Is there some type of event I could create to run once getBounds i...

Recursive function looping through obj props not working

why does this only alert 1 ? function test() { var myobj = { a : '1st level prop', b : 'findme', c : { aa : '2nd level prop', bb : 'findme', cc : { aaa : '3rd level prop', bbb : 'findme' } } } function countem(needle,haystack) { var count = count || 0; for(var i in haystack) { if (typeof(hays...

Referring to parent class properties and methods when inside a class property object.

I want to settle this confusion in my mind once and for all! I am having trouble reaching some of my class properties and methods. Now, I know I could use a object literal and append all of my references with the objects name, e.i. animal., but I want to know how to handle this with an instantiated class. Here is a quick example of my ...

How to optimize working with array in the following code in javascript?

Is there a way to make the following code faster? It's becoming too slow, when length of array is more than 1000 records, especially in IE6. dbusers = data.split(";"); $("#users").html(""); for (i = 0; i < dbusers.length; i++) { if ($("#username").val() != "") { if (dbusers[i].indexOf($("#username").val()) != -1) { ...

Simple jQuery question about .live()

Not sure what I'm doing wrong with .live() $(function(){ var wrapper = $('#trailer_wrapper'); var button = $('h2 a'); button.click(function() { wrapper.fadeIn(2000); button.addClass('selected'); button.text('close ×'); return false; }); $('h2 a.se...

Performance of RaphaelJS with thousands of paths/rectangles

Hi, I really only care about Webkit, but in general, is Raphael JS expected to perform well when building thousands of rectangles? Additionally, I would need to be able to handle events on each of these rectangles (yipes). I've got a C++ solution which works but I'd rather use RaphaelJS. Thanks :) ...

javascript /innerHTML / html

Hello, I have a JS function - triggered with onclick -, that is dynamically changing 4 pics in the current page. But where i have troubles, is the displayed set of picture is clickable too, and should display the picture in lightbox. So 2 buttons, corresponding to 2 sets of pictures, a click call a function which changes the innerHTM...

jQuery apply code as each element loads

I am using jQuery to add placeholders to each text box on a page. I could just use $(document).ready() and then iterate through all the elements locating all those with the placeholder attribute and then adding the events to that element but this means that the user could click on the text box before the jQuery code is applied. So I wo...

Execute javascript in an html document and get the generated source in C#

Hello, I was wondering how I could go about retrieving the javascript generated values along with the html found in a website in c# 4.0. Any help would be greatly appreciated. Thank you. ...

The jQuery .ready() event and building content in javascript

Hi, let's say I have a simple javascript like so: $(document).ready(function(){ if(login == "1") { showExtMenu(); //Show the logged in user the extra menu links } else { showRegMenu(); //Show the user the regular menu } }); showExtMenu and showRegMenu populates an empty div with some html code. My question is, will...

Sensible Way to Pass Web Data in XML to a SQL Server Database

After exploring several different ways to pass web data to a database for update purposes, I'm wondering if XML might be a good strategy. The database is currently SQL 2000. In a few months it will move to SQL 2005 and I will be able to change things if needed, but I need a SQL 2000 solution now. First of all, the database in question u...

Javascript object dependencies

In complex client side projects, the number of Javascript files can get very large. However, for performance reasons it's good to concatenate these files, and compress the resulting file for sending over the wire. I am having problems in concatenating these as the dependencies are included after they are needed in some cases. For instan...

Selecting child text with jQuery

I have a structure like the following: <form> <input type="text" /> <input type="text" /> ... <input type="radio" /> <input type="whatever" /> Here I have some text </form> I cannot change the structure of the HTML. I need to remove via Javascript the text inside the form, and the problem is to select it, since...

Good book for learning language-design/implementation?

Hi, I would like to start contributing to Cappuccino -- mainly though, Objective-J. I have a good understanding of JavaScript, but not of language design/implementation. Is there a good book that covers this topic(s)? Thanks. ...

Adding links to specific phrases or keywords in jQuery

Hello, I am trying to turn specific words or phrases into links with jQuery. So far I have only been successful in changing a span with a class="link" to an anchor tag after a hover event. My problem is that I want them to change when the page loads. As an added benefit it would be nice to target any words or phrases without having t...

Problem with form validation (phone numbers)

Ok, I have a validation script that checks everything on the form - but it flags the phone number fields as wrong regardless of whats in there. I've tried it a couple different ways and I cant figure out what I am doing wrong. The part of the script that validates is... if (testPattern(phone1, /^\d{3}$/)== false) { // checking pho...

jQuery Selector - checked and class begins with...

I need to get the value of the first checkbox which is checked and who's class name begins with 'rqc', eg. rqc205 I have tried this: requestID=$('#requestsTable').find('input[class^='rqc']:checked').val(); but it yields nothing, whereas requestID=$('#requestsTable').find('input:checked').val(); works but does not limit to the class. ...

Are HTML-based AIR apps equally fast/powerful v. Flex AIR, or just a "lesser" sibling?

I've got a HTML/JS (YUI framework) photo-organizer that needs access to the local FS. Should I move HTML/JS to AIR, or bite the bullet and "port" it to Flex AIR? I know what the marketing says, but I want the real answer -- what an I "giving up" by going HTML/JS AIR? I'd like to get some feedback from people with deep experience buildi...

CSS/JavaScript/hacking: Detect :visited styling on a link *without* checking it directly OR do it faster than me

This is for research purposes on http://cssfingerprint.com Consider the following code: <style> div.csshistory a { display: none; color: #00ff00;} div.csshistory a:visited { display: inline; color: #ff0000;} </style> <div id="batch" class="csshistory"> <a id="1" href="http://foo.com"&gt;anything you want here</a> <a id="2" hre...