javascript

Hover text at mouse created from firefox toolbar add-on

Hi all, I'm creating a firefox add-on, and I have a situation where if someone clicks on a specific item in my toolbarbutton menupopup, I want to display some text to appear beside the mouse for a couple seconds. I don't mean mouseover text, because when they click on the item, the I close the menupopup. I mean something like what's s...

IE Problem in jQuery

I am using the jQuery plugin Cross Slide. My page is working fine in Chrome and Firefox. But in IE 7, I get: Debug error as Object expected on line 1: $(document).ready(function() { $('#image').crossSlide({sleep:4,fade:1},[{src:'images/1.jpg'},{src:'images/2.jpg'}]); }); How can I fix bug in IE 8 & 7? ...

What are the best Javascript/Flash frameworks to render graphs or charts from data?

Ideally I'd like to do as little preparation data work on the server as possible. The less I have to do to prep the data from the database to make a given chart, the happier I am and the more view I can make in the time. Some of the things I'd like to chart are, for example: The distribution of a series of response times The number of...

Javascript - How to extend Array.prototype.push()?

I'm trying to extend the Array.push method so that using push will trigger a callback method, then perform the normal array function. I'm not quite sure how to do this, but here's some code I've been playing with unsuccessfully. arr = []; arr.push = function(data){ //callback method goes here this = Array.push(data); return this.l...

Looking for particular alert box behavior

I'm interested in alert boxes such as, http://www.visual-blast.com/javascript/nice-alert-box-with-jquery-impromptu/ and http://woork.blogspot.com/2008/08/design-stunning-alert-box-using.html but with a different functionality, the user should be able to interact with the page even with the alert box present, so it needs to be movable...

javascript pointer function

Hi, if I have: function init(t,y,u) { alert(t + " " + y + " " + u); } // String.prototype.add = init(5, 6, 7); // 1) // window.onload = init(5,6,7); // 2) in the 1) init will be executed and then it pointer assegned to String.prototype.add but in the 2) the function is only executed one time... but why not two times also whe...

How does JavaScript .prototype work?

I'm not that in to dynamic programming but I've written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one who know how this works? var obj = new Object(); obj.prototype.test = function() { alert('Hello?'); }; var obj2 = new obj(); obj2.test(); I remember a lot talk I ha...

Get everything after the dash in a string in javascript

Hi, What would be the cleanest way of doing this that would work in both IE and firefox. My string looks like this: sometext-20202 Now the 'sometext' and the integer after the dash can be of varying length. Should I just use substring and index of or is the other ways? ...

I have a jquery autocomplete entry that I want to add a down arrow image inside of

I have a jQuery autocomplete entry that I want to make look more like a "combobox". I set it up so that when the user clicks into the entry it will blank out and do a blank query to show all possible matches. I want to add a special "down arrow image" inside of the autocomplete entry so that the user knows to click on that arrow like i...

How to access an iframe in an Adobe AIR application?

Hello, I am trying to use the embedded webkit in AIR to write a little browser with HTML+Javascript. I am so displaying the page at the URL typed by the user in an iframe. From there, I would like to: access the content of the frame, for example to display the of the page on a tab. be alerted when the user clicked into the frame, f...

Upload selected area as image to server

I want to create a application (Firefox extension ) which will grab a screen area and save to image and upload to server. Here is my roadmap. First I will create a greasemonkey user script which will applicable to all domain, When any page will load , It will add a small button named "screengrab + upload" . when User will click on button...

Make this function defensible against null/empty strings etc.

Hi, How can I make this function a little more 'defensible' against null/empty strings? function getSecondPart(str) { return str.split('-')[1]; } ...

Position divs in a tag cloud structure without overlap?

Hi, I wondered if someone could help. I need to build a system that pulls numbers out of an array and displays them in a cloud like pattern (a range of different sizes and colours). I'm stumped on how to build a system to create the divs so they don't overlap and make a nice tight structure. Any pointers would be great. Mock Up: http:/...

IE Overwrite window.top

I'm trying to convince a page that it is the window.top even though it is in an iframe. In FF you can do window.defineGetter('top', function() { return window}); in Webkit (Safari/Chrome) you can simply do window.top = window but in IE none of those methods work. Anyone done this before? ...

Why does dumping all JavaScript files into one giant file change their behavior?

I took a snapshot of the jquery.js file and jquery-ui files that I use and dumped them into a giant .js file with all of the other .js files that I use for my site. When I do just this with no minfication/packing, the files stop working and I get "recursion too deep" errors on the file when I try to load it on my site instead of the usu...

JQuery: Finding the Object that created a DOM Element

So I've been working on this all day and I can't figure out how to get it to work. I have a table with TD's filled with content which is drawn from a database using a JQuery "getJSON" command. I have an event handler set-up so that when you double click a TD element, its contents become a INPUT element with the default value of the enclo...

Endless background-color animation in jQuery, how?

Hi, I'm working on a web form where I wish to (after form submission) highlight those input fields that weren't entered correctly. The highlight effect I wish to create is an endlessly looping animation between background-color: #fcc; and #fff; in the faulty input fields, using jQuery. When one of those fields gain focus, I wish to stop...

Jquery append using multiline

I have been working on a project that dynamically creates a javascript file using ASP.NET which is called from another site. This jquery javascript file appends a div and fills it with a rather large HTML segment and in order to do that I need to turn the segment into a string like so: $(document).ready(function(){ var html = "Givin...

Javascript - check if method prototype has been changed?

What's the best method to check if the protoype of a method has been changed? ...

Javascript syntax <script /> VS <scrip></script> - the weirdest thing

Duplicate Why don’t self-closing script tags work? I'm writing an ASP.net page, which have some Javascript code in JS file for client-side authentication. While using this code prevented from my server-side code from working: <script src="../../JavaScript/BaseJS.js" type="text/javascript" defer="defer" /> This code somehow ...