javascript

Passing a large dataset to the client - Javascript arrays or JSON?

I'm passing a table of up to 1000 rows, consisting of name, ID, latitude and longitude values, to the client. The list will then be processed by Javascript and converted to markers on a Google map. I initially planned to do this with JSON, as I want the code to be readable and easy to deal with, and because we may be adding more struct...

Working example of jeditable and autocomplete working together

I see a lot of google posts on this but all seems to be talking about how this is in progress. Does anyone know of a working version of jeditable and autocomplete functionality working together so i can click on text and get a textbox and have autocomplete functionality working against that textbox EDIT: I am opening a bounty, as it s...

javascript: "Object doesn't support this property or method" when ActiveX object called.

I've got simple html on Login.aspx with an ActiveX object: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html> <head><title></title> <script language="javaScript" type="text/javascript"> function getUserInfo() { var userInfo = MyActiveX....

How to display messages in invalidHandler in JQuery validator

I'm trying to use the JQuery validator on a form and am trying to figure out to get the messages of the errors in the invalidHandler option (or if there's somewhere else, do tell). When a user clicks the submit button, whatever the first error is, I want to display an alert box with the message of the error. I don't want the error to be...

how to get a data from a DB using MYSQL and store it in javascript Array.

Hi all, Is there any possible way to get a data from a DB using MYSQL and store it in javascript Array. Thanks in Advance ...

Elegant workaround for JavaScript floating point number problem

Hi, I have the following dummy test script: function test(){ var x = 0.1 * 0.2; document.write(x); } test(); This will print the result "0.020000000000000004" while it should just print "0.02" (if you use your calculator. As far as I understood this is due to errors in the floating point multiplication precision. Does anyone...

JavaScript - Detecting when neither of two inputs has focus

I want a certain function to be called when neither of two inputs on the page has focus. If the user merely switches from one input to the other, I do not want the function to be called. Any ideas? ...

Make onclick handler ignore clicks on links

I have a custom onclick handler for a block element (set up through jQuery's .click() method). This block element can contain links. I'm fairly certain this is possible, so, how do I have the handler simply return if it was a link I clicked on (so that the link is visited without running my code)? ...

Javascript array operation

var arr = ['test','hello']; is there a javascript native call to get index of some value('hello') in an array? ...

How to determine if Javascript object is an event?

What is the safest way to determine if a Javascript object is an event? ...

Replace JavaScript with ActionScript in DHTML

I need to write a DHTML page. But, since I have most of the code inside an AS3 library, I want to use ActionScript instead of JavaScript to do the most of work. In this case JavaScript layer (if any) would be just a write-once abstract proxy. I know about ExternalInterface stuff, but I want something more high-level, which would ease cr...

Generating strings with # number of characters

Is there way of generating a string made up of 250 underscores, without using a loop? I want to avoid writing code like this: var myString= ''; for (var i=0; i < 250; i++) { myString += '_'; } ...

Javascript decimal to binary operation

var d = 7; in binary: 7 = (111) What I want to do is to set second place from right to 1 or 0 at disposal, and return the decimal value. For example,if I want to make the second 1 to 0,then after process should return a 5, because 5=(101). How to implement this in javascript? EDIT the answer should be something like this: funct...

Ext is not defined

I'm trying to implement a TinyMCE plugin with ExtJs, with a demo as example, found here: link. This fails because I receive an "Ext is not defined" error in Firebug. I basically copied the example, I only used a newer version of Ext. First of all the css and scripts are included: <link href="scripts/extjs/resources/css/ext-all.css" rel...

Extjs Ext.ComboBox autosize over existing content

Hi I have a problem when apply an Ext.ComboBox over an existing html select item, even if the existing content makes the html select about 20px (by it's content non static width is set), the Ext.ComboBox will resize to a sort of default, large, width value. There's a way to auto resize the Ext.ComboBox based on the existing items and no...

How to show full screen popup with JavaScript?

Dear all, I would like to show full screen popup with JavaScript? I use this code below but it isn't works on Firefox and Opera browser. function detectVersion() { version = parseInt(navigator.appVersion); return version; } function detectOS() { if (navigator.userAgent.indexOf('Win') == -1) { OS = 'Macintosh'; ...

Height of content inside a div

The content of a page is loaded inside a div: <div id="content">Some content</div> The div has a fixed height and uses scroll in case of overflow. I want to adjust the height (make it smaller) of the div onload if the content does not need the fixed height of the div. How can i meassure the height of the content inside the div? I tri...

calculate the total and display

I have array with decimal value 1.19, 1.44, 4.59 and so-on How to calculate sum and alert. ...

How to use www.addthis.com

Hi all, I need to use addthis.com plugin to my website, when they click the email link, i need to pass my own data to the plugin, that needs to be sent to client. Is there anyway to accomplish my goal? ...

slideshow for div's background image + jquery

Hi friends, I have a big div element at header and there are many text contents and some boxes in the div. and i have a big img as bg for this div, now i need to make a slideshow for this div's background :/ How can I make slideshow for a div's background image? I researched a lot, but could not find anything :/ Thanks a lot! apprec...