javascript

jQuery Textarea Caret Position to End on Focus

I have multiple textareas on a page and would like to set the position of the caret to the end of the text which changes per textarea (textareas do not contain similar length values). How would I initiate this on focus to move caret from the position they select to the end? Thanks in advance. -B ...

How to use YAHOO.util.Connect.asyncRequest and return results ?

I'm using YAHOO.util.Connect.asyncRequest to get data from database, here is the code : function getCountArticle(contentCurValue) { var handleSuccess = function (res) { var countPubmed = YAHOO.lang.JSON.parse(res.responseText); var contentCountPubmed = countPubmed.totalArticleRecords; alert(contentCountPubmed); //re...

JQuery: How determine child ordinal position? Need: $("#parent").ordinalChild('#some-child') => 3 (say)

Because Jquery UI tab doesn't support passing id selector to remove() tab method, and no method exists to map id to index, I have to painfully "jump hoops" to determine the index of the tab I wish to remove. I just searched the documentation for JQuery and wasn't able to find a utility method to return an integer of the ordinal positi...

jQuery Javascript large scale application development

Hi, I have just been asked to describe the architecture for a large scale dashbaord style project that i will be working on. I have bever worked on a application of this size and am a bit lost as to what to say. Could i be pointed in the direction of any articles that may help me get started and hopefully finished. I have gleaned the...

How do i get rich controls in PHP?

Hello, How do i get rich controls like tree, calendar etc in PHP? PHP by default doesn't include any such controls. I am planning to use either CakePHP or Zend framework as i heard from my friends that these two are really nice frameworks. Do these frameworks include support for tree and such controls? I actually come from Asp.Net and J...

Appending the jQuery callback function when extending the library

Short version: I'm extending a jQuery object function that is intended to take 0-3 arguments and pass them off as the second to fourth arguments into jQuery.animate. Except, I want to isolate the callback and put in another function call at the end of it. I'm extending the jQuery library the ordinary way, through jQuery.fn.newfunction...

Update variables inside the jQuery $(document).ready() base scope?

I'm trying to find a way to minimize the number of Selector look-ups. My issue is that I have a variable defined with base $(document).ready() that needs to be updated inside functions nested inside $(document).ready() Consider this example (EDIT: I updated it to be more explanatory) <script> //var $current_page = $home_page; **<--I ...

Problems with javascript and h:commandLink

<a href="#" onclick="return oamSubmitForm('display_form','display_form:link_prev');" id="display_form:link_prev"> &lt; Prev</a> <a href="#" onclick="return oamSubmitForm('display_form','display_form:link_next');" id="display_form:link_next"> Next &gt;</a> </div> </td> </tr> <tr>...

MOOTOOLS variable scope

I'm using mootools: I can't figure out how to use a variable when using an addEvent. I want to use a for next loop to set values in a loop: for (x=0;x<num;x++){ var onclickText = 'function (){onclick="addPageMoveEvent('+x+'"); }'; $('pageNum'+x).addEvent('click', onclickText); } > I've search forums but not found any help. Any help...

ASP.NET C# Read in JavasScript File and Parse Method Names with Certain Signature?

I'm wondering the best way to approach this. I have a JavaScript file in my web app that has a bunch of different methods all with the same signature. What I want to do is read in the JS file server side and parse out all the method names of only the methods that have that certain signature. Let's say my JS file looked like below: fu...

JavaScript: opacity works in opera but not IE

Hi guys, I have used the following script for images and it appears to work fine; yet in Internet Explorer, the text is not fading out as it should. Any ideas? <td colspan="5" ID='links'> <ul id="navlist"> <li id="active"><a href="#" id="a" onmouseover="over(this)" onmouseout="out()">Apie įmonę</a>|</li> <li><a href="#" ID="b...

window.onfocus event doesn't fire in Google Chrome?

Hi folks, I have a situation where I want to confirm a user is still allowed to edit a page when the page gets focus. This will prevent them from giving up editorship in one tab and then returning to edit in the original tab, or giving up editorship and then using the browser BACK button to return to the page where they could still edi...

jquery star rating vertical

Hey all. I'm using the jquery star rating plugin by fyneworks. The problem is that about 5% of the time (and on the initial page load), the stars stack vertically instead of horizontally!? When you refresh the page, they are fine - which is really odd. Please see the page here: http://bit.ly/byhFLu Any suggestions would be greatly app...

Facebook Connect JS API / Internet Explorer trouble

I'm building a Flash-based (AS3) website that incorporates Facebook Connect through a combination of the AS3 API and the Javascript API. Everything is working fine in Firefox; users are able to authenticate / login via the site, and I can make calls and receive userdata from Facebook without a problem. However, in IE (7 & 8, at least),...

Deep inheritance with JavaScript?

Hi, I know that I could do a simple prototypal inheritance in JavaScript like this: var Parent = function() { }; var Child = function() { } Child.prototype = new Parent(); Child.prototype.constructor = Child; However, I'm curious to how one would accomplish deeper inheritances? What about multi-inheritance, is that possible? ...

Elastic lists in Javascript

I recently came across Elastic Lists & found them totally cool. Is anyone aware of a javascript library which can give me elastic lists ? If not , any tips on writing it myself too would be most welcomed. :) Thanks, ...

Wanted: jquery plug-in for gaming-machine-like display of numbers / high score

I'm looking for a jquery (or other javascript) plug-in that shows and animates numbers like a high-score on a gaming machine, similar to this: Is there anything like that? ...

Can I use JavaScript to send HTML to a new tab/window and have the CSS loaded?

I have some JavaScript in a page that makes a call to a server and gets some HTML that I want to display in a new browser tab or window. I can use window.document.write(myHTML) to put the HTML in the new container but the HTML contains some CSS and JavaScript includes and these do not get included by the new window. Is there any way to g...

get an instance of the form being submitted in javascript

I want to get a handle on the form being submitted, before submitting. There might be more than one form in the page I do not know the form name/id reason: I want to do some tweeking before the form is being submitted in the template level. ...

immediate children of a list

Hey, A quick question.. what's the JAVASCRIPT statement to get the immediate children of a LIST? I tried: document.getElementById(id).getElementsByTagName('li'); which gives me all of the child nodes. ...