javascript

Does anyone know of a good site for beginning in YUI?

Does anyone know of a good site for beginning in YUI? The developer's manual on Yahoo is too confusing for me. ...

Count number of table rows between two specific rows with jQuery

<table> <tr id="parent_1"> <td>Parent 1</td> </tr> <tr class="child"> <td>Child 1</td> </tr> <tr class="child"> <td>Child 2</td> </tr> ... <tr id="parent_2"> <td>Parent2</td> </tr> ... </table> How can I find the number of child rows between parent_1 and parent_2 using jQuery? Edit: Sorry, didn't ma...

How can I do client side text formatting on a Data-bound field inside a repeater?

I have a repeater control with some html controls being populated from some server side DataSource. The code for these controls inside the repeater looks something like this.. <img src='<%# DataBinder.Eval(Container.DataItem, "Path")%>' title='<%# DataBinder.Eval(Container.DataItem, "Name")%>' alt=""> I needed to format some of the te...

Writing a JavaScript zip code validation function

I would like to write a JavaScript function that validates a zip code, by checking if the zip code actually exists. Here is a list of all zip codes: http://www.census.gov/tiger/tms/gazetteer/zips.txt (I only care about the 2nd column) This is really a compression problem. I would like to do this for fun. OK, now that's out of the w...

Javascript: This evaluates to true and false at the same time! What is going on?

Does anyone have an explanation of how javascript could do this. Somehow this function is both true and false at the exact same time. This is just one pass, no looping or anything. console.log(key); if (this.watches.get(key)) { console.log("found it"); } else { console.log("whhhat?"); } console.log(this....

Bypass the alert and error that occur while screen scraping

I have created a web page to screen scrape a site, while scraping from the other site; there is some error on that site so it's throwing an error (object expected). But finally I get my result perfectly. It shows that the error occurs in my program. Is it possible to bypass those errors (without showing them on the screen). I don't wan...

Accessing location information on iPhone from web application

Is there any way for a web application to access the location data of an iPhone without the installation of an additional iPhone client app? If not, the next best thing would be if any can recommend an existing native app, preferably free to the end user and as lightweight as possible, that does expose this information to Mobile Safari....

JS: wait till other frame load

Hi Is there a way to wait with script till frame will load fully? The frame is from other domain. ...

Hide a link with a specific class and attribute

I have this html. <a class="link" href="www.website.com?id=233253">test1</a> <a class="link" href="www.website.com?id=456456">test2</a> How can I hide one of these links by using the href attribute, and just the last numbers (233253), to hide the link with this href attribute and the class "link"? This is not a working code, just som...

how to combine fixed height header with flexible page layout

Problem: how to combine fixed heights with flexible page layout? "bodyDiv" height needs to be : 100% of ( window.innerWidth less ?px ). "a" & "b" height need to be : 50% of ( body.div.height less ?px ). <HTML> <body> <div id="headerDiv" style="height:?px">fixed height</div> <div id="bodyDiv" style="he...

Why is array.push sometimes faster than array[n] = value?

As a side result of testing some code I wrote a small function to compare the speed of using the array.push method vs direct addressing (array[n] = value). To my surprise the push method often showed to be faster especially in Firefox and sometimes in Chrome. Just out of curiosity: anyone has an explanation for it? You can find the test ...

Phototagging like in Facebook and Orkut album photos?

Is there a jQuery library or any leads on implementing that photo tagging like in Facebook and Orkut Photo albums? Thanks ...

Javascript Array .length property/method of JavascriptEngine

I'm just curious how this is done directly by browsers. I heard that .length property of Array in Javascript Engines in fact uses invisible setters and getters to achieve functionality of ECMA-s standard that says: "whenever the length property is changed, every property whose name is an array index whose value is not smaller than the ne...

blogengine without php or asp.net etc.

Is there a way to have a blog directly integrated into my HTML/javascript-only website, without having to have something like a SQL-database and a dynamic engine like PHP or MySQL? Maybe there is some service in the web that offers this (hopefully without ads :) ). Or maybe I can have a blog engine entirely written in javasript? ...

Disable image from caching?

** edit it seems that when the javascript changes the image that the reflection gets an undefined src. Any thoughts on that ** I've got this problem where I'm using jquery to reflect an image. I've got this news title list and it's automatically jumping through titles. Each time it changes the image and the reflection. This works pref...

Dynamically changing height of div element based on content

I'm working on a Facebook-like toolbar for my website. There's a part of the toolbar where a user can click to see which favorite members of theirs are online. I'm trying to figure out how to get the div element that pops up to grow based on the content that the AJAX call puts in there. For example, when the user clicks "Favorites Onl...

Whats the best, most simple ajax file uploader?

I have asp.net 3.5 website, and i want to put an ajax uploader, but i want this ajax uploader to: don't refresh the page while/after uploading easy to integrate free Not swf upload control i will use it in uploading images, so want a simple way to get the uploaded image file name, and be able to tell it in which folder to upload to. ...

How to insert an element in DIV at position X Y

Hi! I am trying to create a webpage where users can insert a pin (like google map) in between the text using context menu. My problem is that i do not know how to insert the pin at the exact position. Using the DOM I can arrive only to the nearest DIV (by using this) but a DIV contains a lot of text and the PIN has to be positioned nex...

How to change html tag attribute value from RJS template?

Is it possible to change a html tag attribute value from an RSJ template? I know that there is a page.replace_html method, but it is not very useful in my case, since I have lengthy values of various attributes (such as alt, title of an image). What I want is change src attribute of a img tag in RJS. Is that possible at all? Thank you. ...

Google Maps api access possibilities for iphone? (processing javascript without UIWebView)

I want to access some data from Google maps. the only way possible is using JS for that. I'm not trying to access it through a webview. usercase: I have point 1 (lat,lng) and point 2 (lat,lng). I want to use Google maps api to determine what the driving distance is between those 2. So in other words I want to use the Google maps ap...