javascript

Jquery plugin qTip - scrollLeft is not a function

Hello all, I am trying to make use of this JQuery plugin: http://bit.ly/2TXYrb I have tried to implement it but I get an error reported by firebug. f(window).scrollLeft is not a function [Break on this error] (function(f){f.fn.qtip=function(B,u){var...asses:{tooltip:"qtip-blue"}}}})(jQuery); Please have a look at my setup: http://bi...

Slideshow2 Mootools problem in IE

Hi, im trying to implement Slideshow2 but I have problems with IE, as you can see in this test: http://kb.muscarienlinea.com/mo/ the Slideshow works ok in FF and Chrome, but is not working on IE7 What im missing? Thxs :) ...

OOP in javascript with callbacks

I want to close my window (just a div with position absolute that is draggable) when I click on the close link This is my code function ApplicationWindow() { this.window = $('<div class="window"></div>'); this.create = function create() { //..... var closeButton = this.window.find('.close'); closeButton...

alternative to html top.document inside iframe

Hello, We have a web application where we're using "top.document" since this application uses iframes and sometimes we must reach the top document. The problem started now since we need to integrate this application in a website and we put it inside an iFrame in this very site. Since the application uses "top.document" it is reaching t...

Disabling links to stop double-clicks in JQuery

How would I disable all links with the button class after they are clicked once? I'd like to be able to do this in one place, and not have to change all of them individually.. any ideas? So far I got this: $("a.button").click(function() { $(this).attr("disabled", "disabled"); }); $("a[disabled]").click(function() { return false; }); ...

How is this "object expected" JavaScript error possible?

Apparently this line of code is triggering "Object expected": var bPid = (b != null && typeof (b.processId) == "number") ? b.processId : 0; Unfortunately I can't step through the code in the debugger since this is an intermittent error that shows up in a Windows SideShow gadget that I'm writing. But, I'd imagine someone should be able...

How is the "Google-Promote/Restore"-animation implemented?

I love the animation running when you promote (or later restore) a search result on google. This can be done by clicking the little arrows at the end of a result item. The item is moved up or down with the rest of the page still visible. Check it out. Did anyone work with the corresponding javascript or program a similar thing? ...

Is there a way to make HTML.ActionLink Invisible by default?

I am trying to hide HTML.ActionLink by default when page first renders and then control it's visiblity based on the page the the user is on. Any suggestions? Thanks! ...

What is wrong with this validation?

Hi. I have had several threads about validating my textarea; for some reason it won't validate. The function that validates doesn't seem to be called at all. Here is the form simplified: <form name="annonsera" id="annonsera" method="post" enctype="multipart/form-data" onSubmit="return validateForm();"> <textarea name="annonser...

Periodic refresh or polling

I am trying to use periodic refresh(ajax)/polling on my site by XMLHttp(XHR) to check if a user has a new message on the database every 10 seconds, then if there is inform him/her by creating a div dynamically like this: function shownotice() { var divnotice = document.createElement("div"); var closelink = document.createElemen...

how can we date mask a text field using javascript / jQuery?

I am having a text field for date. Now i would like to mask this text field so that a user can input only date value. I even found a jQuery plugin for this. But that doesn't seems to help, as you can input 22/22/2222 in the field that too is accepted by this plugin, which is obviously not a valid date. What is the possible solution? ...

JavaScript mechanism for holding onto a value from a user action

I've created a JavaScript object to hold onto a value set by a user checking a checbox in a ColorBox. I am relatively new to jQuery and programming JavaScript "the right way" and wanted to be sure that the below mechanism for capturing the users check action was a best practice for JavaScript in general. Further, since I am employing jQ...

jQuery resize to aspect ratio

How would I resize a image in jQuery to a consistent aspect ratio. For example setting maximum height and have the width resize correctly. Thanks. ...

Updating page HTML causes endless loop

I'm writing a Firefox extension. The extension replaces certain words on the page with other words. Here's the basic code I'm using: function startup() { gBrowser.addEventListener("load", pageLoad, true); } function pageLoad(event) { if (event.originalTarget instanceof HTMLDocument) { var ht = content.document.body.inner...

jQuery rounding problem with .val()

I have a textbox where a user inputs a number, like: 105.14 When I use jQuery to read it: alert(parseInt($("#Info").val())); It displays "105". Why can't I get the remaining .14???? I'm sure it's something obvious.... ...

How to control sound in a pure DHTML game

I am looking into writing web based games using just Javascript, HTML, and CSS. It seems like there are large classes of games could be done using these technologies, except for one thing. I can't really find a good way of controlling sound, the only thing I see that it works is to embedding a control of some sort into the page. Is the...

How to simulate click on <input type="image" /> ?

when we submit a form using this type of input, the coordinates (x,y) are appended to the result. it works if I dynamically create 2 hidden inputs, but I wanted something different. Event or MouseEvent would be great, but I couldn't make it work here's my current code: (it works fine) var input = document.createElement("input"); input...

getting the contents of a function in an `onclick` attribute in my html with jQuery

What?! I know, what a bad idea. Firstly I have no control over the html that was output, its from a vendor and it is produced via their crazy system that our company has an agreement with. (let's not talk about the situation, I know it's not optimal) In the html I have: <a id="notify" onclick="location.href='index.php?foo=bar';retur...

In JavaScript, how can I get all radio buttons in the page with a given name?

Like the title says, what's the best way in JavaScript to get all radio buttons on a page with a given name? Ultimately I will use this to determine which specific radio button is selected, so another way to phrase the question: Given a string variable in JavaScript, how can I tell which exact radio button input element (if any) with t...

IE6 Javascript problems with $Revision$ in the filename

We recently started using SVN Keywords to automatically append the current revision number to all our <script src="..."> includes (so it looks like this: <script language="javascript" src="some/javascript.js?v=$Revision: 1234 $"> </script>). This way each time we push a new copy of the code to production, user caches won't cause users t...