javascript

Overlay SVG diagrams on google maps

Hello I would like to add an overlay image on a google map. This image is a SVG file I have generated (python with svgfig). I am using the following code if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(48.8, 2.4), 12);     // ground overlay     var boundaries...

A way to fade in the background on load?

I am working on a website design, and I need a way to fade in the background image of the body tag when it is completely done loading (perhaps then a pause of 500 ms). If you see August's website design you will see the background fades in; however, this is done with a Flash background. Is there any way to do this with jQuery or JavaScr...

Clickable images (IMG's) but need the mouse icon to change over it...

I have click-able images in my html page that call a javascript function... however nobody is clicking on them as they do not look click-able... how can I make them click-able without using an <a href=""></a> tag around it? Here is an example of my code... <div id="bvu11" style="margin: 0px 5px; float: left;"> <span id="bviu11"> ...

Firefox javascript bookmarklet open tab in background

I've written a bookmarklet to look a word up in a Chinese dictionary: javascript:Qr=document.getSelection();if(!Qr){void(Qr=prompt('%E8%AF%8D%E8%AF%AD',''))};if(Qr)(function(){window.open('http://nciku.com/search/all/'+Qr);})(); This opens a new tab with search results for your selected word or a word you type in at the prompt. Is the...

Why can I not define functions in jQuery's document.ready()?

Functions come up as undefined if I place them in the document.ready() function: $(document).ready(function(){ function foo() { alert('Bar'); } }); foo(); // Undefined Why does this happen? I'm sure I'm just in need of some simple understanding :) ...

JSON serialization in Spidermonkey

I'm using python-spidermonkey to run JavaScript code. In order to pass objects (instead of just strings) to Python, I'm thinking of returning a JSON string. This seems like a common issue, so I wonder whether there are any facilities for this built into either Spidermonkey or python-spidermonkey. (I do know about uneval but that is not...

Stop events from triggering after they've been triggered once

I have the following code: $('body').mousemove(function() { $('#covering').fadeOut(500); $('.block div div').fadeOut(250) $('.block div div').css('margin-top','160px') $('.block div div').fadeIn(250); }); Basically what I am trying to do is have have a "covering" div fade out (as in this question) and have a few block elements's i...

Ajax/Flash file uploads with a progress bar?

I'm looking for a simple solution that will be: Easy to integrate Allow multiple file uploads Show a progress bar while the file is being uploaded Any ideas? I've tried Swfupload and its a real pain to integrate. ...

file I/O in Spidermonkey

Thanks to python-spidermonkey, using JavaScript code from Python is really easy. However, instead of using Python to read JS code from a file and passing the string to Spidermonkey, is there a way to read the file from within Spidermonkey (or pass the filepath as an argument, as in Rhino)? ...

How can I make just IE ignore a class?

IE handles one of my div's classes totally wrong. It works in every other browser I tried. I want to simply not apply the class to the div in IE. Is there a trick to make IE not apply it? More info: The div has multiple classes. I want to still load one but not the other in IE. The classes are defined in a Javascript file. Thanks. Mike...

Using Ajax, is it better to generate aditional markup in the server or the client side?

Which is better in AJAX request, Response with ready HTML or response with just data and write HTML using JavaScript, and this JavaScript will use a predefined HTML template to put the coming data inside and show on the page. Creating the HTML on the server and send to the page, will decrease the client side JS code, but will increase t...

Skip some code if the computer is slow

Is there any way to detect if a computer is slow and not run some code (by either turning jQuery animations off or just running a function if it is fast)? I know this question is probably really trivial, but I noticed that on some slower computers even the simplest margin animation to move something is done in flashes that doesn't look ...

Saving user input directly into variable in JQuery

I don't want to have a formal form field but save every user input directly into a variable and append new letters to a field every time the user enters a new letter. What command do I need? ...

how can i make the google maps bubble longer in height?

i want to be able to put more information into the bubble so maybe making it dynamically longer based on the content that is inserted into it. thanks ...

Resize all containing elements with javascript utilizing em

I have a situation where I think using the 'em' metric would be perfect. I have a container with several elements inside. These elements all use em for dimensions, font-size, borders.. everything. I want to be able to grow or shrink all of these elements dynamically by simply changing the em value of the parent container. At least that...

What sort of memory leaks should I watch for with jQuery's data()?

Should I pair every data() call with a later removeData() call? My assumptions: jQuery's remove() will remove elements from the DOM, and if I don't have any other references to remove, I don't have to do any more clean up. However, if I have some javascript var or object referring to one of the elements being removed, I'll need to clea...

preventing JS running when the page is not loaded

I have encountered a problem. When I use jQuery to load a page that contains heavy javascript, the page freezes. I believe it is because the js executes before the page loads as my local site does not freeze. However, $(document).ready(function(){}); seems not working with dynamically loaded pages? is that true? or anything i could do to...

[TinyMCE] Remove styles when pasting from Word or other source.

I'm trying to set it up so that when I paste text, specifically from Word or another source, all the styling will be stripped. I'm happy to let bold and italic styles stay as well as lists and so forth, but the rest should go. How can I do this? I know there is a plugin that will allow me to do this if I paste via clicking a button but...

Javascript/HTML > Form/Input > automatic firing every time a page loads

I had to take my working example here. For some reason, it does not work as easily as the initial example. New Example Suppose I want to see M5s every time the page loads. So how can I fire the same query for M5 every time the page load? I copied the critical part here: <body> <div id="search"> <form onSubmit="makeRequest(1)...

How do I achieve equal height divs with HTML / CSS ?

I have two divs inside of a container. One on the left, one on the right, side by side. How am I able to make each one be of equal height, even though they have different content. For example, the right div has a lot of content, and is double the height of the left div, how do I make the left div stretch to the same height of the right ...