javascript

Making Facebox wait until FLV player has loaded.

Not entirely sure how to do this, but I noticed that Facebox works perfectly, but when I use it to load a movie, the FLV Player, JWplayer isn't fully loaded yet, and errors out. So I want to load JWplayer ( the FLV player ), before Facebox. Facebox gives this as their embed code. And they explain that you can pass an argument in it as w...

Remote Javascript Execution in a Local HREF

I have been trying to locate an example of remote Javascript execution from a local HTML 'a' tag. This is not going to be a malicious execution. On my index page, I use Javascript to hide divs and bring a single div to the front - in order to have multiple pages on one (in a nutshell). I typically do this using the following example snip...

Limit posting to every 30 minutes

Hey. Thanks for looking. I'm trying to write a script to set a cookie after the user posts a comment, limiting them from posting again for 30 minutes. I'm so confused on where to start. Please, could you guys help me out on how I do this? I'm trying to use this jquery plugin – countdown timer. ...

How to call function when assigning an object a value

Hi I the following functions in separate js files //in js file 1 setUsername: function(v){ document.Load.LogUsername = v; } //in js file 2{wrapper for js file 1} LogUserName: function(v) { return myobject.SetLoguserName(v); } When document.Load.LogUsername = v; is called i need it to call the LogUserName function. LogUserName is a w...

How to get the object which represents the selected row in a slickgrid

I have a webpage with a slickgrid which renders an array of objects on a grid. I want to do some dynamic stuff (a master-detail like setup) when the selected row changes. However to be able to do this, I would need the data of the selected row. I know that the grid.getCurrentCellNode() function will give me the dom element of the current...

Javascript Regex to target and remove a css rule from a style tag, based on its selector?

What would be the regex I could use to completely remove a css rule from an inline stylesheet based on the selector that I provide, via javascript? For example, I get the contents of the style tag and it contains a rule: .some_class { color: #FFF; font-style: italic; } If i provide the selector '.some_class' what is the corre...

Attempting to access DOM nodes, getting wrong nodeValues and lengths.

I have the following HTML : <ul id="nav"> <li><a href="#">One</a></li> <li><a href="#">Two</a></li> <li><a href="#">Three</a></li> <li><a href="#">Four</a></li> </ul> On attempting to walk the element, 1 nav.childNodes.length is 9, What are the nine nodes? 2 nav.childNodes[0].nodeType is 3, but .nodeValue is empty. ...

Timeago + DateJS = NaN

I'm trying to use timeago (source), with datejs, and it's not working. Here's some sample code I'd expect to work (given that timeago and datejs are loaded): >>> d = new Date() Mon Jun 21 2010 13:24:37 GMT-0400 (EST) { _orient=1, more...} >>> d.toISOString() // datejs.toISOString "2010-06-21T17:24:37.501Z" // this is a valid ...

How to validate email field in javascript?

This is the script I use for form validation: <script language="JavaScript"> function formCheck(formobj){ var fieldRequired = Array("Name", "Email", "Phone", "comments"); var fieldDescription = Array("Name", "Email", "Phone", "Comments"); var alertMsg = "Please complete the following fields:\n"; var l_Msg = alertMsg.le...

How to detect a web dropdown menu is going to display off screen

I have a CSS based simple drop down menu with multi-levels. The second or third level might go outside the visible window, with certain combinations of resolution and window size. Some pre-built menu controls just open the dropdown to the left instead of the right, if they detect this situation. How can I test (with JS/jQuery) for this...

ie8 and selectedIndex and windows.onload issue

Hello, To set the selected index of my dynamic list, I tried to use: // Runs on load of page and after submit work is done window.onload = function(){ var sSel = document.getElementById("server"); sSel.selectedIndex = 0; // the next call that creates a dynamic listbox fails. It does not // s...

escape & in url

Hi all How can I escape & (ampersand) in url with the correct replacement in the jQuery function. I have tried .replace("/&/g", "&amp;") .replace("/&/g", "%26") .replace("/&/g", "\&") But nothing is working. If anyone has idea please share with me. Thanks ...

php redirect not working but... working...?

So I changed the structure of my site around some and such and I guess I broke the script some how. When the user fills out a form correctly, they should be directed to the appropriate page. Instead it just sits there. However, if I test the form directly from form.php it works. Here is some info on the form. form.php is the actual for...

Make input form read-only?

I have a bunch of forms that have a lot of <input type="text"> fields on them. The user now is requiring that I provide a "read-only" version of every single form. I would recode every field into an <xsl:choose> <xsl:when test="/..../permission = 'E'> <input ....> </xsl:when> <xsl:otherwise> ... </xsl:otherwise> </xsl:choose> m...

javascript validation on text boxes created dynamically

In a form a text box is created dynamically by clicking on add button such that the text box is created in a new row.Now my problem is the validation of text boxes which were created dynamically such that it shows a message if any of text boxes are left empty when form is submitted by clicking submit button.Please help me out. EDIT <...

Prepend/Append don't Work (Opera, Safari, Chrome)

Camarades, I tried using the append and prepend (), but none of the controls work. Could anyone help me? In Internet Explorer and Firefox works. The Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;head&...

Foreach file in directory jQuery

How can I do a foreach(File file in Directory) kind of thing in jQuery. Thank you! ...

Conditional validation with jquery

Ok this is driving me crazy. I have a user account page. Where you have the option to change your password. I want a conditional jquery validation that if the user types in a new password in the new password box the box that confirms the password as well as the box that asks for the old password is turned into a required element. here is...

How to access properties of JS object in parent window from iFrame in IE7?

I have a JS Object called CoolThing that exists in the top window. I have an iFrame, same domain as top window, that needs to access a property, CoolProperty, in CoolThing. The javascript in the iFrame to access CoolProperty, which works perfectly in FF, webkit, and IE8, is: <script type="text/javascript" charset="utf-8"> with(windo...

Run jQuery animation continuously throughout entire website

I'm running an infinite loop of a color changing background on my website using the jQuery timers plugin (plugins.jquery.com/project/timers): jQuery(document).ready(function($) { $('body').everyTime(1,function() { $(this).animate({ backgroundColor: "#000000" }, 20000).animate({ backgroundColor: "#ffffff" }, 20000); }); }...