javascript

Including Prototype.js twice causes conflict in IE7

I am using the Prototype javascript framework. I have included it in a javascript code snippet that I allow people to copy and paste onto their websites. There is a possibility that their website already includes Prototype or they wanted to include the snippet multiple times. In both cases, Prototype will be defined twice and, as a resul...

A custom fn to override location.hash in TOC or Nav list.

This follows on from the thread I began here: http://stackoverflow.com/questions/3173073/capture-the-next-main-block-element-using-js Later on new issues became apparent and I had 2 refine and add to what I had already, to cover these unforseen eventualities. I have 2 questions: Is the try catch block a sound idea? Have I covered al...

Why JavaScript says that a number is not a number?

Hi, I have a piece of JavaScript code which is expected to set an integer value to a variable. Something is broken, so when I try to do alert(A);, it returns NaN. isNaN(A); returns true. But if I alert(typeof(A));, it says number. So how can a variable be a number and not a number at the same time? Maybe I misunderstood what NaN reall...

JavaScript object definition conditionals - which is better?

I've come across two different ways to define/name objects and functions in JavaScript that first check for the existence of the name before using it. The issue is, I don't know which one is better (from speed and usability standpoints) and it's impossible to use the boolean operators in a Google search to figure it out. The first one ...

Script to insert data on different domain

I am thinking about writing a script that will perform a sort of checkout procedure automatically similar to a program like Ebay snipe. I will know what the page exactly looks like. All I really want to do is load the page from a different domain than the one that is running my script into an iframe, have jquery insert the data into the...

Get ID value from set of radio buttons

Hello, I'm trying to get the ID value of the set of radio buttons. Here is the radio buttons. <input id="1" type="radio" title="2" value="6/1/2010" name="vacationDay"> <input id="2" type="radio" title="2" value="6/2/2010" name="vacationDay"> <input id="3" type="radio" title="2" value="6/3/2010" name="vacationDay" checked='checked'> H...

On Screen (touchscreen) Web Keyboard

Hi, I have a webapp that needs to have the option to be used in a kiosk-style, touchscreen-only environment. Am wondering whether there are any good browser-based keyboards we could use. Probably something javascript or jquery based. Basically we would like to replicate the experience of typing on a mobile browser, but in a normal br...

jquery select text from between text

i want to grab the text between two tags, which is in main div, following is the example... <div class="main_result"> some text.... <div>other divs</div> <p>some other html</p> <div class="bread_crump"></div> text i want to grab <b>selected category</b> some other text and div... </div> obviously following example dont work, but i...

How do I pull information from an LDAP server using JavaScript?

I have the LDAP server hostname and the search base, but have not been able to find any way of using that information with javascript. this is to be used in a windows sidebar gadget. ...

How to format this date type 2010-06-24T00:00:00Z to sun,24/06/10 7.15 p.m (CDT) using javascript or jquery

How to format this date type 2010-06-24T00:00:00Z to sun,24/06/10 7.15 p.m (CDT). using javascript or jquery. sun,24/06/10 7.15 p.m (CDT) this is just a format representation which i need & not the actual date of the above string. Appreciate the quick response Thanks in advance! ...

Access cross domain nested iframe from within the main iframe

I have a page that has a cross-domain iframe. On the page loaded in the iframe is a print button that runs some javascript to print an iframe named printFrame sitting on the page (on the nested page, not on the parent page). When I click on the button, in FF it works but IE gives me an error: frames.printFrame is null or not an object....

how to use $.makeArray() with jQuery

Can anyone explain me how to do this, jquery's api is really lacking on this. What is wrong in the following code? var arr = $(value).filter(function() { return $(this).is("TD"); } ).html(); alert(arr[1]); I just want to grab the innerHTML/text of the td and put it in an array ...

Http headers in Javascript ?

Hello, Is it possible to gather the HTTP headers in Javascript ? This is just a thought of mine after using Firebug for days In one of the posts I came to know that, it is impossible to find the HTTP headers in Javascript, whereas in firebug, we can see the response headers ( client side ) so my doubt is can we cache the HTTP hea...

How to convert html string as html dom element?

I have a webservice that returns html string as response. I want to display the response in a div element. The response I am getting from service is <span style="text-indent: 29px;padding-top:35px;font-size: 16pt;font-family: Arial;color: #FFFFFF;font-weight: bold;position: absolute;text-decoration: none;">89</span> <span style="text-in...

Javascript component for window/pane flip effect?

I'm prototyping a thin client UI using extjs and am looking for an effect that will simulate a form/pane flipping over to reveal another form/pane. Its for a details view for an object that has two major sets of properties. I found a flex component that can do this, and can even simulate four different forms on the faces of a cube. ...

What languages can be compiled to javascript?

Possible Duplicate: What compilers target JavaScript runtimes? Like CoffeeScript. I don't really like javascript, and it will be nice if I could replace it. ...

Problems calling fitbounds outside jquery.each()

Hi, im working on a Google Map in javascript(v3). I need to show some markers from XML, for wich i use Jquery. heres the object and function, might save me time explaining: var VX = { map:null, bounds:null } VX.placeMarkers = function(filename) { $.get(filename, function(xml) { $(xml).find("marker").each(functio...

JavaScript Back Button Failure

So I thought this script was pretty straight forward: <a id="BackButtonlnk" href="#" class="white" onClick="history.go(-1)"></a> When I click it it briefly shows the previous page but just looks like it refreshes and you never end up at the previous page. ...

jQuery Cycle Plugin: scrollHorz with Prev/Next - automatically scroll without user interaction?

Using the jQuery cycle plugin: jquery.cycle.all.min.js - latest version (2.8.8) from http://malsup.com/jquery/cycle/ I'm utilizing the scrollHorz effect with prev and next links. Works beautifully except for one thing, when the page loads, the slideshow isn't automatically scrolling, it requires the user to click prev/next. Is there a ...

javascript templating with data bindings

I've been playing around with a few js templating engines. They all seem to offer fairly standard features and make generating html with JS much simpler. I have yet to discover an engine though that offers data bindings on elements. I'd like to be able to do something like: render template with data to a particular div update all ...