javascript

prototype and document.getElementById()

Why doesn't this work? Maybe someone could enlighten me :P var balloon = function(){ }; balloon.prototype.iHeight = document.getElementById("wrapper").clientHeight; window.onload = function(){ var oBalloon = new balloon(); } Im just trying to understand prototype a little better. ...

Detect registered protocols in Windows from web page using IE

Programs for MS Windows can associate some protocols with them. So when you click in browser, registered program for protocol "myprotocol" will be opened. Like "mailto:[email protected]" opens your Email programm. I have a website and want to know if visitor of my web site have registered some protocol in his system or not. So when he clic...

How to change pager text in jquery cycle

I am trying to change the text of the jquery cycle pager element. By default is is 1, 2, 3 etc. I would like to just make a customized name for each one. Here is the url: http://www.rockymountainsports.ca/web/layout.html Any help is great, Thanks ...

Dynamically populated google maps sidebar

Hi, I've been using the code from this V3 example to set up a links bar that dynamically populates when different category filters are selected, but have two problems at the moment. Firstly, I've put the the initial makeSidebar function in the map's idle event, but the sidebar is only created when the map is moved, not on loading of the...

Can't access ExtJS radio button on form

So I have an .aspx page. In this grid I'm adding a bunch of controls. The first control however is an ExtObject, not one of our preset VB.NET controls. When I go to access the value on the backend for this field with this code: form.AndOr.getValue() It doesn't work. I really have no idea what is wrong. Basically, the radio button valu...

Firefox addon to do something everytime a user hits Enter in the address bar

Hi, I'm trying to write an extension that monitors every time someone types hits enter when using the address bar. The steps would be something along the lines of User types in a bunch of text in the address bar and hits Enter My addon springs to life and recieves what the user typed in My addon then decides what to do with the string...

Easy way to drop XML Namespaces with JavaScript?

Is there an easy way, for example, to drop an XML name space, but keep the tag as is with jQuery or JavaScript? For example: <html:a href="#an-example" title="Go to the example">Just an Example</html:a> And change it to: <a href="#an-example" title="Go to the example">Just an Example</a> On the fly with jQuery or JavaScript and not...

javascript regex question

i want to check for certain regex expression to make sure some string is followed by '::' and some number. The number can be between 1 and 999999999999. for example: 'ACME LOCK & KEY::42443' should pass where 'ABC Inc.' should fail. any help? ...

How to add an extra link to the excerpt in wordpress

I'm trying to get this link to look like this: Comment on this show >> | Listen to this show >> Where "Comment on this show >>" gets populated properly with its permalink. "Listen to this show >>" link should be populated with that posts 'Listen Now' custom field value. function holylandmoments_comment_link() { return ' <a class="rea...

get position of a textbox on my form in px

Hi I want to set the position of anew div box relative to the position of the comments box on my form. I can position the div but am struggling to get the value of the text box. I was thinking this would work but it doesn't pos = document.getElementById('comments').style.top.value any help please ? ...

Why does my timing code always return 0?

hi guys , i was optimizing my html5 game engine for performance issues and i want to know how much time a render process needs.So i got a bunch of render functions.Each of them render seperated parts of the game.. such as blocks , players etc. function gameRender() { var d1 = new Date(); var firstTime = d1.getTime(); // ren...

Accessing binary data from Javascript, Ajax, IE: can responseBody be read from Javascript (not VB)?

First of all, I am aware of this question: http://stackoverflow.com/questions/1095102/how-do-i-load-binary-image-data-using-javascript-and-xmlhttprequest and specifically best answer therein, http://emilsblog.lerch.org/2009/07/javascript-hacks-using-xhr-to-load.html. So accessing binary data from Javascript using Firefox (and later ...

How do I add an onclick event to html tags without id's using javascript?

I tried doing this but it didn't seem to work: window.onload = initAll; function initAll(){ document.getElementsByTagName('a').onclick = clickHandler; } function clickHandler(){ if(this.toString().indexOf("localhost") < 0) { confirmation = confirm("You are now leaving http://soso.com. Please cli...

Changing slideshow images according to season-Possible conflict with jquery cycle plugin?

I am trying to automatically show images based on what month it is with javascript. I am also using the jquery cycle plugin for the slide show. I originally just had the images within the HTML and everything was copacetic. Now when loading the images source with javascript there is a long pause before the first picture loads up and al...

How to sort an array of hashmaps in javascript

I have a small question regarding the sorting of a JavaScript array. I have an array which holds basically a hashmap: dataOfTheUserArray=new Array(6);, which is basically an array of hashmaps. The map looks like the following: keys: values Symbol xyz NumberOfStocks 1o Price 200 So the ar...

How do I reference a nested array within my JSON data?

Hello, I need assistance in accessing a nested array located my JSON Data Set. Here is the first entry of my top-level JSON array: { "pingFeed": [{ "header": "Get Drinks?", "picture": "images/joe.jpg", "location": "Tartine's, SF", "time": "Tomorrow Night", "name": "Joe Shmoe", "pid": ...

JavaScript: JSLint throws "Read Only.

My code: note: the Slider Object is declared but omitted in the snippet below for better readability "use strict"; /*global arrayContainer, SliderInstance, DomObjects */ arrayContainer = new Slider.constructArray(); SliderInstance = Object.beget(Slider); DomObjects = { animationContainer: document.getElementById('animationContain...

IE 7 jQuery .append functionality not working

I have the following snippet of code: $("#QnAList").append("<div id=qdiv" + i + " class=divBase> <span id='" + i + "'>" + msg.d[i].QuestionText + "</span> <span id='display'" + i + "'>" + answerDisplay + "<span class='triage'> </span></div>"); msg.d[i].QuestionText is the problem that I'm having. In FF it is displaying the text perf...

How can I handle errors in loading an iframe?

I have an <iframe> that other sites can include so their users can POST a form back to my site. I'd like to handle gracefully the cases where my site is down or my server can't serve the <iframe> contents (that is, a response timeout or a 4xx or 5xx error). I tried adding an onError to the <iframe> object, but that didn't seem to do any...

HiddenField value modified by javascript is not posted back

Hello Everyone, This is weird, but I've been using this method all over my code: I have dropdown lists that I populate client-side, using callbacks and because of this I'm unable to access their selected values from code behind and using a hidden field to store selected value in it. I had no problem retrieving the hidden field's value o...