javascript

error in recording the values

Hi, I have a Experiment which records value for each image depending on whether target is present or not, images scroll on the screen pause for 3 seconds and scroll off.I have placed all the images in an array and corresponding to it i have created an image ID array which has 0 and 1 values, 0-target 1-No target, depending on this 0 and...

IE7 issues with my jQuery [click and change functions]

I have the following snippets of code. Basically what I'm trying to do is in the 1st click function I loop through my cached JSON data and display any values that exist for that id. In the 2nd change function I capturing whenever one of the elements changes values (i.e. yes to no and vice versa). These elements are all generated dynam...

Load specific XML content to HTML

I'm trying to load specific content from a XML to a HTML div. I'm using a function with parameters to do this. This my call to function: loadDoc("news.xml","destak-article","article"); this should send a request for the xml file, get the content of «article» tag and put it on the «destak-article» div. Here's my function body: funct...

Javascript formatting broken in visual studio 2008

I do not have a listing for JScript in my studio options under Text Editor. Thus my studio will not format javascript for me when i type a semicolon. This is a new machine for me. My old machine has this listing. I have uninstalled and reinstalled studio 3 times with no luck ...

Using multiple tab-blocks on the same page (jQuery)

$('.tabbed-block .tab-content:first').show(); $('.tabbed-block ol li:first').addClass('active'); $('.tabbed-block ol li a').click(function () { $('.tabbed-block ol li').removeClass('active'); $(this).parent().addClass('active'); var a = $(this).attr('href'); ...

Using javascript to open a shell

Is there a reliable crossbrowser way to open up a shell using javascript (e.g. explorer.exe)? ...

jQuery.Get() help

Hey, I'm trying to use the jQuery.Get() function to return the contents of a webpage. Something along the lines of - var data = $.get("http://mysite...../x.php"); I know the above is wrong, can someone help my out here? Cheers, ...

Without using document.write how can I insert a DOM node where the current JS is executing?

<body> <div id="outer"> <script>var e = document.createElement("div"); e.id = "inner1"; document.body.appendChild(e);</script> <script>document.write("<div id='inner2'></div>");</script> The structure I want would be: html>body>div#outer>div#inner1+div#inner2 the structure I get is: html>body>(div#out...

Why do you need the + between variables in javascript?

Why does this line work $('#body-image').css("background-image", 'url('+ backgroundimage +')'); but not this one $('#body-image').css("background-image", 'url('backgroundimage')'); or this one $('#body-image').css("background-image", 'url(backgroundimage)'); ...

Can node.js execute JavaScript functions pulled from CouchDB like CouchApp does? How?

The quick overview is this: for my web app I can write most of my functionality using CouchApp and CouchDB views, etc. I love the feature of CouchApp that pushes my code up to the server via replication- this makes the deployment cycle very easy. However, to do some arbitrary work not supported in couchdb and works around a few limita...

Sproutcore or Cappuccino for Ruby-on-rails?

Rails is a very great backend framework keeping everything clean and structured. I guess that you all have thought about doing the same for the frontend. Sproutcore Cappuccino Do you use one of thes MVC javascript frameworks for the frontend with Rails? In case you do, do you feel satisfied with it? How did you code before and how...

JavaScript Class methods not working

I have the following code, which is written for the Titanium framework for mobile application development. The problem that I am having is that the loadPage() method is not calling the other methods. What am I missing here? Titanium.UI.currentWindow.barColor = Titanium.UI.currentWindow.barColor; Titanium.UI.currentWindow.title = 'My M...

Flexible JavaScript functions (for MongoDB)

I'm working on some Map / Reduce queries for MongoDB and am trying to do the following (in a nutshell). m = function() { this.convert = function(val) { return val+1; } emit(convert(this.age), this.doesWearGlasses); } r = function(k, v) { count = 0; for(var i = 0; i < v.length; i++) { count +...

How can I automatically track PayPal donations and display it on my site?

Hi, I would like to automatically track PayPal donations and display the current donation amount in my site. So, How can I do it? Should I use PHP? Do you know tutorials for it? Thanks ...

Handling images from XMLHttpRequest (with HTML and Javascript)

I am using an XMLHttpRequest to fetch an image from a server (run locally from a third party server-applet) A simplified version of the code is shown below. The image is returned as a JPEG and the returned header shows "content-type= image/jpg". I can view the information via Firebug for Firefox. However I am having a terrible time...

When is it dangerous to line break after a close parenthesis in Javascript?

What are the dangers of breaking a line of long code up at a close parenthesis? When could a semicolon be automatically inserted by Javascript (presumably that is the danger, right?). Why is using a ) as a line breaker "frowned upon" by JSLint? In Javascript I sometimes see one long line of code broken up at a ) like this (example): ...

how to prevent select item in dropdowlist using javascipt?

I want prevent user to select dropdown list items using javascript methods. Is there anyway use OnMouseKeyDown so I can stop there. I donot want use Enable=false. Javascripts gurus, help me out. ...

Browser-neutral way to start local process from intranet

We currently have a corporate intranet built with ASP.NET and originally designed for IE. One of the purposes of the intranet is to manage file versioning and to launch programs with the current file version. This requires the intranet to start processes on the machine locally, and is done using ActiveX. We are now reworking the intra...

How do I get the coordinates of a div?

I have used jQuery UI library to drag divs within a web page. While dragging, the div changes it's position and modifies CSS postion,top and left properties. My questions are: 1) Is their a way in javascript to get the values of CSS properties and save on a variable(so that I can submit it to XML)? Those CSS properties are created on r...

search for element within an array.

My data[l][m] contains 1,2,3,4,5 I'm trying to search for a particular number, say '2' in it. Is there a better way to do this? for (var n = 0; n < data[l][m].length; n++) { if(data[l][m][n] == num){ // num is equal to '2' number = data[l][0]; document.form.options[l-1] = new Option(number,number,true,true); } } ...