javascript

Using onchange for 3 linkeddrop down list menus

Hello All, I have 3 drop down lists and they are linked together: Category Name, Subcategory Name, Name. Each one of them is retrieved from the database perfectly. The link between category and subcategory in the tables is category Id and for the name between it and subcategory is the subcategory id. Now, my question is that I need to...

Multiple jQuery UI date pickers with different styling

I have two jQuery date pickers on my page: A regular one A "special" one that can only pick years/months. The special one uses some custom CSS (from here) to hide the calendar part, so only the month/years show up. .ui-datepicker-calendar { display : none ; } However, since there is only one dialog instance on the page, the ca...

Javascript Bring window to front if already open in window.open?

If you open a window like: window.open ("url","winName","location=0,width=300,height=214"); If winName is already open it just changes the URL in the window. This is ok but if that window is behind the current window most users won't realize this and think that it is just not opening. Is there anyway that if the window is already ope...

How can I pop up a element from a website into a windows with Greasemonkey?

Hey, I want to pop up an image or a div/class from a website into a window with Greasemonkey, how can I do it? For example, I want to pop up the stackoverflow logo to a small window (the size of the logo) when I enter the site. ...

if folder exists, return true

I can check if a folder is empty. this.emptyfolder = function(folderid) { result = PlacesUtils.getFolderContents(folderid); resultContainerNode = result.root; if (resultContainerNode.ChildCount == 0) { return true; } else { return false; } } How to check if a folder exists even if it's empty? link...

Content script communicate with bg page [Synchronous]

Howdy, ok I'm aware that a content script can communicate with the background page using: chrome.extension.sendRequest({action:'test'}, function(response) { //code here... }); someFunction(); But is it possible to communicate synchronously? Basically wait until the response comes back to the content script before executing someFun...

Select element by index (multiple elements of same class)

Is there a way to select a element by index with Javascript or jQuery? For instance: <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> Under jQuery I could get the length as 4, now is there a way to select and then manipulate a element of "div.item" based on its index number? ...

If statement in javascript forms

Hello Im fairly new to javascript but have some experience in HTML. I am trying to create a form which allows me to select an option from the drop down menu, which further expands the form (showing new fields on the same page) depending on the option selected from the drop down menu. I figured I need some sort of if statement to achieve...

jQuery access parent object attribute?

So I have this code: function theObject(){ this.someelement = $("#someelement"); this.someotherelement = $("someotherelement"); this.someelement.fadeOut(500, function(){ this.someotherelement.attr("title", "something"); this.someelement.fadeIn(500); }); } for some reason this.someotherelement is undefine...

FlowPlayer onError - updating clip URL

I am looking to change the URL of a clip when the stream is not found. I am properly configuring the onError event, as I can debug the specific line or add an alert, but what I am having trouble with is the following: onError : function(errorCode, errorMessage) { this.getClip(0).update( { url : 'http://full-url.com/images/stream-not...

make sure an image is loaded while dynamically changing jquery

I'm changing the image src of an image node. I want to be able to make sure that it's changed before executing somecode. How would i do that? right now i have function changePic(imgNode, newPic, desc){ var descNode = $("#description"); $(imgnode).fadeTo(500, 0, function(){ $(imgnode).attr("src", newPic); $(imgn...

Using jQuery, is this the most efficient way to combine similar functions into .each()?

I'm using jQuery and the Datatables plugin. When a row is clicked, a hidden row appears with details about that record that can be edited. After those details are edited and the hidden row is closed, the cells of the main table that have changed are updated. Here's my old code: function teacherTableUpdate(nTr) { oTable.fnClose(nTr)...

Do not allow Paste any non alphanumeric characters

I don’t want user to allow pasting of any non Alphanumeric characters on a text box. How do I restrict this in Javascript? Thanks!! ...

Best JavaScript book for beginners

Possible Duplicate: Good JavaScript Books? By beginners I mean, someone thats an expert in Java, knows object oriented programming extremely well and is a beginner to being a web developer. But has no knowledge or experience at all in JavaScript. ...

testing for undefined in JavaScript

I want to run a code only if the argument[0].recordCount is greater than zero or is NOT undefined. However, the code is ran when the argument[0].recordCound alert shows undefined. if(arguments[0].recordCount > 0 && arguments[0].recordCount !== 'undefined') { //if more than 0 records show in bar document.getElementById('totalRe...

I have a couple thousand javascript objects which I need to display and scroll through. What are my options?

I'm working off of designs which show a scrollable box containing a list of a user's "contacts". Users may have up to 10,000 contacts. For now assume that all contacts are already in memory, and I'm simply trying to draw them. If you want to comment on the question of how wise it is to load 10k items of data in a browser, please do it...

Popup Window will not Close

I want to close a popup window from an error page. The process is: Submit a form At form submission, watch a popup window open If an error is thrown after form submission, then view the page (not the popup) redirect to an error page At this time, the popup window should close. Given the timing of the opening of the popup window a...

moving select options up and down via jquery

so I got this code working for Firefox and Chrome...what it does is it allows you to reorder the options within an HTML select form...but then when I tested the code via IE8, it's kind of patchy...it only works for the first few clicks and after that you have to click many times on the button for it to work.. Does anybody know any other...

How to attach an event to a button in an iframe

Right now I have a jQuery UI dialog with an <iframe> inside of the dialog. When the user pushes a button, the dialog pops up with a form-editing screen in the iframe. Well, I want to have two buttons in the inner form-editing screen, "cancel" and "ok". Cancel doesn't save changes and closes the dialog, ok saves changes and closes the d...

convert date/time

Hi everyone, Right now in my code, I have $('#StartDateTime').val(new Date(event.start).toLocaleDateString() + " " + (event.start).toLocaleTimeString()); which this displays "Thursday, July 22, 2010 8:00:00 AM". I was wondering if anyone could help me on how I could convert it to just plain "07/22/2010 08:00 am"? I would ap...