javascript

Firefox 3.6.x does not fire off my onload event

Hi, I have a Firefox 3.6.2 problem (3.5.x works just fine). This is the code: ... var newImage = new Image(); newImage.onload=function() {swapMapImg(newImage);}; newImage.src = newBackground; ... function swapMapImg(newImage) { alert('bingo'); } Firefox 3.6.2 no longer fires off my onload event, any ideas? ...

iPhone: What are the Advantages and Disadvantages of Developing with CSS/Javascript?

There are alternatives to developing for iPhone besides the native Objective-C API. In particular, there are CSS/Javascript based solutions such as the iUi Framework. Can you write successful iPhone apps with CSS/Javascript? Does Apple approve such apps? What are the advantages and disadvantages of using this approuch? Thanks in advan...

How to get all Div within a table using javascript

please tell me how can i get array of all Those DIV of specific table whose LANG="1" using javascript table structure is like this: < table > < tr > < td > < div id=1 lang="1" > some metter < /div > < /td >< /tr > < tr > < td > < div id=2 lang="2" > some metter < /div > < /td >< /tr > < tr > < td > < div id=3 lang="1" > some mett...

How can I add methods from a Java class as global functions in Javascript using Rhino?

I have a simple Java class that has some methods: public class Utils { public void deal(String price, int amount) { // .... } public void bid(String price, int amount) { // .... } public void offer(String price, int amount) { // .... } } I would like to create an instance of this class a...

a simple problem about RegExp in Javascript

I have a text: <font class="myclass">class abc</font> and i have a pattern: class now, i want to find the word "class" before "abc" but not in the <font class="myclass"> ,how could i do with RegExp in javascript? Thanks! :) ...

how to get the google map's pageX when dragend ,the version is v3..

this is my code: google.maps.event.addListener(marker, 'dragend', function(event) { alert(event.pageX)//undefined }); and i want to get the (x,y) about mouse when dragend.. thanks ...

Is it possible to remember the filename from a fileupload field and then later launch that file via javascript?

I have a HTML file upload field from which I'm reading the file name of the file that the user specifies. The actual contents of the file is never uploaded. At a later stage, is it possible to construct a link using this file name information so that if the user clicks on this link, the original file is launched into a new browser windo...

Is there a way to give CSS syntax highlighting to any <textarea> using any bookmarklets?

Is there a way to give CSS syntax highlighting to any <textarea> using any bookmarklets or favlets? I work on a CMS where I write and manage CSS in a plain <textarea> like Notepad. Is there a boomarklet to enable CSS syntax highlight in specific <textarea> temporarily? Should work in IE. ...

Why does the month argument range from 0 to 11 in JavaScript's Date constructor?

When initializing a new Date object in JavaScript using the below call, I found out that the month argument counts starting from zero. new Date(2010, 3, 1); // that's the 1st April 2010! Why does the month argument start from 0? On the other hand, the day of the month argument (last one) is a number from 1 to 31. Are there good reaso...

Watin + Teamcity = error 8007007e

I try to run some javascript unit tests (in addition to my Nunit tests) on a project in TeamCity, by using Watin. I am not very familiar with either Watin or Teamciy, so forgive me if I have missed some vital information along the way. Anyway: When I run the test in Visual Studio 2008, it succeeds, but when I try to run it on teamcity i...

comparing strings from two different sources in javascript

This is a bit of a specific request unfortunately. I have a CMS that allows a user to input text into a tinymce editor for various posts they have made. The editor is loaded via ajax to allow multiple posts to be edited from one page. I want to be able to check if there were edits made to the main text if cancel is clicked. Currently I...

What (kind of) project could I create to learn JavaScript?

Hello, I started learning JavaScript a while ago. It's a fairly easy programming language considering that I learned Java in university, that I know php pretty well and that I already played around with python and ruby. The problem is that to properly learn a programming language I usually create a project. In javascript, I just don't kn...

extracting the post parameters from a form using javascript/jQuery before submission

how can i get the parameters of any form being submitted with method=post before it's submitted using javascript(preferably jQuery). What i am trying to do is get the post parameters and submit it to an alternate loacation. i was using $('form').submit(function(){ alert('action= '+$(this).attr("action")); aler...

"Phased" execution of functions in javascript

Hey there! This is my first post on stackoverflow, so please don't flame me too hard if I come across like a total nitwit or if I'm unable ot make myself perfectly clear. :-) Here's my problem: I'm trying to write a javascript function that "ties" two functions to another by checking the first one's completion and then executing the se...

Convert an HTML form field to a JSON object with inner objects.

Given the following HTML form: <form id="myform"> Company: <input type="text" name="Company" value="ACME, INC."/> First Name: <input type="text" name="Contact.FirstName" value="Daffy"/> Last Name: <input type="text" name="Contact.LastName" value="Duck"/> </form> What is the best way serialize this form in javascript to a JSON ob...

Possible to have multiple sizes of custom selectboxes?

I've been searching for a good way in which to style up a selectbox, and have found a couple of good jQuery plugins that do the trick... However, they replace the selectbox with an input and a list and then give it a specific class which is used to add your custom styling... This is fine and dandy, but I need to be able to use multiple ...

Javascript or jquery replace text

I need to replace some text that is on the page within the body tag. I am using javascript but have jquery available if needed. I basically need to replace test (test with the registered trademark) with TEST or tests with TESTS and it could even be test with TEST or tests with TESTS. I am able to uppercase them but its not liking to work...

target="_top" emulation using JavaScript

Suppose we have frameset of with 2 frames, one frame is kind a tiny horizontal header and second is kind of "content" frame with 3rd-party html page inside. When user clicks on some link inside "content" frame, the whole page (frameset) should be reloaded with this link, the same behavior if "content" frame has "target=_top" attribute. H...

how many javascript setTimeout/ setInterval call can be set simultaneously in one page?

I have to use atleast 2 setTimeouts and 1 setInterval. Does this have any dependency on the browser or javascript engine being used? ...

o3d javascript uncaught reference error

hey, im new to javascript and am intersted in creating a small o3d script: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test G...