javascript

Detect Silverlight server-side

I have a fairly complex Silverlight banner, with interstitials, hovers, active areas, etc. This is specced to work in Silverlight 1/2. As I am an web standards fan, I'd like to accommodate users who do not have Silverlight and switch to an equivelant JavaScript-driven version of each banner if needed. For expediency, I'd love to be abl...

Compare multiple numbers for lotto check form

Hello all, I'm trying to learn javascript, but my knowledge doesn't cover what I want, so I could use some help. I'm trying to make a lotto check form for our family. What it as to do is check the numbers(B) with numbers(A) <SCRIPT TYPE="TEXT/JAVASCRIPT"> function checkLotto() { var goed = frmTrekking.EersteGetal.value var fout = frm...

What DOM manipulation can be done on Text nodes?

I'm going through the DOM using childNodes and I have a reference to a Text node, and I need to modify its "inner HTML" .. but I tried and it does not work or have such a property. Apart from replaceChild(), what functions can I use to manipulate the inner HTML of this Text node? ...

Command line formatter for PHP and Javascript

Are there any command line (not interactive, not web-based) tools that will reformat (pretty-print) PHP and Javascript code? ...

Difference when using last_insert_row() in Javascript function vs. in DB Query Tool?

I have created a table in Google Gears (Sqlite): db.execute('create table if not exists SPALINKS (link_id int PRIMARY KEY, sid1 int, sid2 int, label text, user text, Timestamp int'); When using the Google Gears Database Query Tool (in FF), INSERT with 'last-insert-rowid' work fine. Inserts from Javascript work fine, as long a I don't...

Export multiple values from a single Combo Box? (Adobe Acrobat)

I'm trying to export 2 values from every single item from the combo box field. I have found two methods to insert items into a combo box: 1) insertItemAt http://www.verypdf.com/document/acrobat-forms-javascript/pg_0048.htm 2) setItems http://livedocs.adobe.com/acrobat_sdk/9/Acrobat9_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?co...

jQuery Carousel. How to show the Next or Previous Element only.

Hello, I have a jQuery problem, and I've really tried everything I know (i am so newbie at this) so .. The problem in short is I am doing a simple carousel-like effect. I am using this code. (The div .showarea is the DIV which needs to be rotated (next/prev) but I want to keep only one div shown at a time.) This is the html markup. ...

How to check in JavaScript if XMLHttpRequest object supports W3C Progress Events?

Is there any way to check within JavaScript if XMLHttpRequest object supports W3C Progress Events? I mean here if setting onload, onprogress, onabort, onerror, etc. properties to some handler function would have those function called those events, as described. Additional (bonus) question: is there a way to augment XMLHttpRequest (e.g....

How to get a JavaScript Object's Class?

I created a Javascript Obj, but how can I get back the Class of that Javascript Obj? I want something that similar to Java .getClass() method. ...

Making an element "fixed" if it's being scrolled out

So, I have an element on a webpage that is located under some other elements. This element should, whenever it hits the top of the page be fixed (ie. it shouldn't leave the view.) I've seen this being done on the Webkit Inspector in the resources tab. Does anyone know how to replicate this feature/effect? ...

Jquery: How can I set a modal dialog to display centered relative to html instead of body?

Hi, I'm using a script that greys out the background with a #mask element and centers my .memError message on the screen. The problem is that my site styles both the body and the html elements-- body is fixed-width and centered within the html element. When I use the script below, the #mask and .memError message are both positioned rela...

Adding, Removing and Adding Element again removes its Event

I have a hyperlink with an ID when clicked will perform a certain event using JQuery. JQuery records the existence of this link on document load. Some time during the course of the users visit. I remove that link and the re-add it later. However, that even is not fired off again when that link is clicked after it has been removed and add...

"setting a property that has only a getter"-problem with firefox

So far i was using Safari 4 for testing and debugging my current jQuery Plugin, but as i tried my code out in Firefox it started to complain about something within the JQuery-Framework: "setting a property that has only a getter". I tried to find out wich line exactly causes Firefox to complain and found out that this happens somewhere h...

Anyone know of a jQuery fisheye/dock navigation plugin that is able to have a fixed position?

Hi, I'm looking to put a horizontal fisheye/dock nav on my site, but I need it to be fixed positioning... all the ones I've found do not support fixed positioning. Here are links to some of the ones I've found: jQuery OS X Dock #1 - Doesn't support fixed positioning CSS Dock Menu - This is very similar to the one above... euDock 2.0 ...

attachEvent gives trouble

Hello everybody. I am trying to do drop down horizontal menu in javascript. It's works fine on Firefox and Chrome, however giving me troubles in IE. Here is the code i have function init(){ hideAllSubMenu(); var menuItem = document.getElementById("menu_wrap").getElementsByTagName("div"); for(var index = 0; index < menu...

Showing and hiding a menu on button click, and hiding it with outside clicks

I have the following code that just has controls relating to an item. <ul class="controls"> <li><button type="button" class="button1" value="somevalue">&nbsp;</button></li> <li><button type="button" class="optionsbutton" value="somevalue">&nbsp;</button></li> <li class="options"> <ul> <li>Option 1 link</l...

How can I find out what div a div is in with javascript?

I have a page which will contain 4 static divs with IDs. I will be adding scriptaculous dragable and droppable effects to allow interaction by moving many dynamically generated divs from one div to another. I need to be able to find out which of the static divs the dynamic divs are in. How can I get this information? ...

jquery.get returning php code???

Hi. I am trying to use jquery's ajax $.get(...) function to send a request to my server and have it return some data. I am using the following code: $.get("php/getRocks.php", { name: "John", time: "2pm" }, function(data){ alert("Data Loaded: " + data); }); Instead of getting the the data back, it just returns the entire php fi...

How do you select a css class in Scriptaculous javascript?

Here's a snippet of my code: <div class="myclass" id="demo" style="display:none;">Hello.</div> <a href="#" onclick="$('.myclass').fade({ duration: 0.3, from: 1, to: 0 }); $('demo').appear({ delay: 0.35 }); return false;">Click ME!</a><br /> My Firebug development plugin says: $(".myclass") is null I have tried various other names, s...

Use onmousedown to get the ID of the element you just mousedowned on?

Is this possible? I am attempting to write a function for onmousedown that will return the ID of the element you just clicked for later use in recreating that element in a different div. ...