javascript

ExtJS: Ext.formHtmlEditor and Firefox: scrollbar appears when large negative vertical anchor value is set

When I create HtmlEditor on a form and assign it's anchor value large negative number there appears absolutely unnecessary vertical scrollbar. Hot to get rid of it? If I resize Ext window scrollbar disappears. I've tried to set handlers for various window events (resize, show, *render) and call there doRender() — no success. Here is the...

How to apply class to first button of the div?

I have this html and I want to apply class to first button of the DIV. <div class="button-container"> <button class="save" /> <button class="reset" /> </div> I want to add class to the first button. I want to use jQuery for this solution. ...

XML error in JavaScript file

When I execute this JavaScript file in Firefox; <script type="text/javascript" > $(function () { $(".comsubmit").click(function () { var comsn = $("#comsn").val(); var comrn = $("#comrn").val(); var compic = $("#compic").val(); var comment = $("#comm...

JavaScript subtraction problem

I thought I'd write a simple script to animate my webpage a little. The basic idea was to make a div grow bigger and smaller, when I push a button. I handled the growing part well, but I can't get it to shrink again. It would seem, after long debugging, that the subtraction in JavaScript just isn't working. Basically, it seems, that th...

How to get handle to entries within SVG <g> group?

Within a document, I can use document.getElementById() to get a handle to a particular unique element. How can I do the same for a group, given as a parameter. <g id="right_hook"> <circle id="wheeltap" r="3" stroke-width="1" /> <path d="M 0 0 L 200 0 A 5,5 0 0,1 200,20" stroke-width="4" /> </g> If I pass this group to a functio...

Duplicate event listeners when multiple windows are open (Firefox extension)

My firefox extension calls an observer function on load that intercepts http requests (http-on-modify-request) from certain domains and opens them in a new tab. The issue I'm having is that if multiple browser windows are open (not tabs, but new browser windows), then the JS for my extension is executed multiple times, and as a result, ...

Evaluate whether a HEX value is dark or light

The user of the ASP.NET web app I'm building can select colors for use on some of the elements (e.g. buttons/titles) to facilitate some degree of personalisation. The problem is that by default the text on those layers is black...what I'm trying to do is to evaluate the HEX value chosen by the user through a picker, and switch between ...

window.close() doesn't work on Firefox, any work around?

Hi, I am trying to close a window using window.close() but this works on IE only but not on Firefox. Has anyone encountered this one and any work around? Thanks... ...

Updating Google Visualization API with <div> button

Fellow Coders, I'm trying to update a Google Visualization API that has already been populated with data. Here's the background: The user get's to choose several options from drop down menu's. After which, the user may select to update the Google API from a button. Do I need a QueryWrapper function, initiated through the button...

JS/Canvas single line animation

Hello everyone, I'd like to make an animation of a single line using JavaScript and Canvas tag. I'm able to do it without any problems, except: it works fine if you're trying to do a straight line - I have an interval (10ms) adding 1px, so if it's going from 150px (x)/20px (Y) to 150px (X)/200px (Y) - everything looks cool. Problem is...

(jquery) enabling a submit button when OPTION value selected

Hi! So I want to enable a submit button whenever an option in my select box (#purchase) is selected (so long as the selection is not the default value. Here is the jquery code I put together, which is apparently not very good. :) $(document).ready(function(){ $('input[type=\"submit\"]').attr('disabled','disabled'); ...

Delete a key from an associative array

Consider var person=JSON.parse('{"name":"Alice","id",1234}'). How do I remove a key from the variable person? For example, how do I remove "name" completely, so that person becoems {"id":1234}? ...

How to get submit button POST Data while submitting by JavaScript form.submit()

Let's say I have this form and script: <SCRIPT LANGUAGE="JavaScript"> function handleSubmit() { return false; } function Delete(element) { var is_confirmed = confirm("Delete this record? \n" + title + " " + date); if (is_confirmed) { document.getElementById("Novinky").submit(); } } </SCRIPT> <form action="index...

What do the FireBug DOM colors mean?

I'm confused with these colors. I noticed there are 4 colors showing in the left hand column of FireBug DOM tree: Bold black Black Bold green Green In the right hand column: Blue Red Bold green Green Multiple color elements representing object structures. What do this colors represent? And why, e.g, I can access window.document.U...

Simple click event delegation not working

I have a div <div class="myDiv"> <a href="#" class="myLink">somelink</a> <div class="anotherDiv">somediv</div> </div> Now, using event delegation and the concept of bubbling I would like to intercept clicks from any of myDiv, myLink and anotherDiv. According to best practices this could be done by listening for clicks globally (h...

how to find buttons with specified text inside using jquery?

I have this code structure , and i want to search for span that has text "Refund Offline" and then add the class hide_button to the parent tag " button". basically I want to hide the button that has "Refund Offline" text. <button class="scalable save submit-button" type="button" id="id_b5295d98b1d6eb3012e2dfd801ede120"> <span>Refund O...

table structure is not coming properly in FF with jQuery

Hi All, I have one table having 10 rows.Now on page load lets say first 7 rows are showing and I have blocked last 3 rows using jQuery. Now on click of a span I want to show last 3 rows..its working fine in IE but not in FF. in FF, when I am loading last 3 rows , the first 7 row css stops working , I mean from 2 nd col, it starts to be r...

Javascript : To check if the fields in a form are not identical

Hi, I have the following problem. The following is the form i have <input type="text" name="email1" /> <input type="text" name="email2" /> <input type="text" name="email3" /> <input type="text" name="email4" /> <input type="text" name="email5" /> I want all the 5 Email ids to be different (unique) i.e, i dont want the user to be ent...

Why jQuery do this: jQuery.fn.init.prototype = jQuery.fn?

Little extended question is why jQuery do jQuery.fn = jQuery.prototype = { init: function() {...}, f1: function() {...}, ... }; jQuery.fn.init.prototype = jQuery.fn; Why not simply add f1() etc into init.prototype? Is it only aesthetic or there are some deep ideas? ...

validation in asp.net using javascript

<script type="text/javascript"> var msg; function req1(form) { if (form.textbox1.value == "" || form.textbox2.value == "") { msg= "Please Enter Username And Password"; return false; } else { return true; } } </script> This is my javascript and i want to use it in as...