javascript

JQuery hide div - resulting in javascript error

I have the following html in page: <head> <script src="jquery-1.3.2.min.js" type="text/javascript"></script> <script> function hideIt() { $(this).hide("slow"); return true; } </script> </head> <body> <div onclick="hideIt();"> hello world </div> </body> When I click ...

Hover not working properly in IE7

Hello, I'm trying to replicate a Facebook wall-like effect where hovering over a feed item displays a "Delete" button. The button is invisible on page load, but hovering over the item displays that particular item's delete button. This is achieved with jQuery and the CSS display property. This works all well and good in browsers such a...

jQuery effects don't work when I add a speed

I'm pretty new to jQuery (and javascript for that matter), so this is probably just something stupid I'm doing, but it's really annoying me! All I'm trying to do is add a speed to jQuery's hide and show functions. The code I'm using is: for (var i in clouds) { $(clouds[i]).click(function() { $(this).hide(); }); } to hid...

javascript object remove

Please excuse my question if it doesnt make much sense. I am using javascript to create a dom element to do that i create an object ( obj ={}) and fill out the properties as i go, one of which is the dom element to be created. once the element is created and appended to the document i do not need the object to occupy any space in the ...

What is the decimal separator symbol in JavaScript?

A thought struck me as I was writing a piece of JavaScript code that processed some floating point values. What is the decimal point symbol in JavaScript? Is it always .? Or is it culture-specific? And what about .toFixed() and .parseFloat()? If I'm processing a user input, it's likely to include the local culture-specific decimal separ...

Why do i see a dollar sign before some constructors in JS?

In JQuery and other libraries i keep seeing a $ sign before constructors. Why? ...

Close browser popup page after downloading file

When user clicks on a hyperlink, i am opening a popup window which downloads a file. Post download, it shows open/save dialog box. I want to close the popup window once the download is done (when user is prompted for saving the file). I have tried window.close method, but it doesnt work as the context is not the popup window but the open...

Copy a javascript URL 'as-is' from a link in a web page?:

I want to copy a javascript URL-char for char. How, for example, would I successfully copy the javascript from the 'View Source' link on this page: http://javascript.about.com/library/blsource.htm doing something like(?): (function(){ var w=open('',''); with(w.document) { write(encodeBlahComponent(document.activeElem...

to change only the table color using javascript

hi evenyone, im new to javascript.. im trying to create a page where when the user selects the colors the particular color should change but only the <table> and its <td> color should get changed on Click function any anyone pls help me in dis.. thanks in advance. ...

Javascript in UIWebView

Hello, I'm using UIWebView to display article and one of functionality requirements is text resizing. Since, setting increased size and reloading UIWebView loses scroll offset I decided use Javascript solution. Article HTML body tag looks like this: <body style='font-size:12px;'> And resizing function basically looks like this: NSStr...

Server code in Javascript

I have: Page.aspx Page.aspx.vb TestClass.vb I'm trying to access a shared property of the TestClass class from the Page.aspx. This code works fine: ... <head> <script language="JavaScript"> <% if System.Globalization.CultureInfo.CurrentCulture.Name.ToLower = "pt-br" Then %> alert('portugues'); <% else %> ale...

Intercept click on content in an iframe

I have an iframe that references an external URL that serves up pages that contain Flash adverts. I need to track how often a customer clicks on one of those adverts. The approach I am taking is to render a div element over the iframe. This allows me to intercept the click event, however I need to pass that click down to the iframe. Is...

Create a text box with an auto-expanding width?

How would I go about creating a textbox with an auto-expanding width to fit it's content? I keep finding plenty of info on height based expansions but not much on width. I'd also like it to apply to every textbox on the page and not just specific ones. ...

JavaScript objects: Destroying them

I have to maintain a JavaScript object with some 30-40 properties, which I update every few seconds. I have read that there is no such thing as "freeing" memory in JavaScript, and the browser automatically garbage collects unused memory. My question is: is it enough to set the object itself to null, or do I need to set all its propertie...

sorting complex JSON object

Refering to earlier questions about referencing elements of and sorting a JSON (javascript) array. See http://stackoverflow.com/questions/2074908/refer-to-an-element-of-json-javascript-object http://stackoverflow.com/questions/979256/how-to-sort-a-json-array Is it possible to sort one branch of a more complex javascript array, such as ...

Creating new markers from an array in Javascript google maps API

Hi I am trying to add markers onto a google map to identify the states using: function initialize() { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(-25.641526,134.472656), 4); map.setMapType(G_NORMAL_MAP); map.setUIToDefault(); var states =["-35.083236,138.503909","-24.607069,144.667969","-1...

Arrays Javascript

I seem to be going around in circles on something I know is really easy. But I must be having a bad day. I want to populate a 2d array dynamically. If I do it statically like this: arrChartValues = new Array(['Q1', 20], ['Q2', 10], ['Q3', 30]); But I want it to be in a loop inserting lots of pairs of values. Any ideas? Thanks Oli...

What is the fastest JSON parser for JavaScript?

I want to show a list with 1000 rows using Json that's support by Struts2 like pug-in. I use flexigrid (jquery) to parse 1000 rows to display. But it's so slow, and sometimes my browser crashes. (Firefox & IE). So, what is the fastest Javascript framework to parse about 1000 rows? ...

Help on testing with Selenium

Hi, I'm trying to make some tests on a JavaScript application and someone advised me to use Selenium. I visited its site but I cannot understand what is it and how can I use it for testing. Can someone help me understand? ...

Using Regex with Javascript

Hi, I'm trying to do this little something into one of my CKEditor plugins: onOk:function(){ var sInsert=this.getValueOf('info','insertcode_area'); if ( sInsert.length > 0 ) { regex = new RegExp('(?<=\?v=)([-a-zA-Z0-9_-]+)', 'gi'); url = 'http://www.youtube.com/v/'+sInsert.match(regex); sInsert = '<object type="...