javascript

Javascript syntax used in hiding html column

I am looking at code that toggles displaying and hiding a table column. I am assuming this creates an array: var States = { }; Why no need for the new operator? Does this line set the States col element .isOpen property to true? States[col] = {isOpen : true}; I am figuring out how to modify this function so I can save the state...

How can I fix this JavaScript syntax error?

This is puzzling me. I'm using Google Map's Geocoding to find locations. I am attempting to use the example here, which is from Google, and it is just not working for me. Error: http://maps.gstatic.com/intl/en_us/mapfiles/159e/maps2.api/main.js Line 174 var point = new GLatLng(,); Code: <script src="http://maps.google.com...

Forcing the Browser Back a Page

Hi there, I was wondering if there was any way through php or javascript I could tell the browser to go back to the page it came from, or even better not load the page at all (the later being probably impossible). The reason for this is that I have written a small php script that will take parameters from the url and post a tweet for me...

Event Bubbling jQuery + Tabs

Hi Everyone, I've just developed a simple page, using the standard jQuery tabs jQuery Tabs Link I've include the jQuery history/remote plugin to allow bookmarking and back navigation. There are some JavaScript elements within the tabs themselves, such as lightbox, which is called on page load. The history/remote plugin seems to be af...

How to make swfupload setPostParams work in firefox?

I want to set some params in my swfupload when some links are clicked, so i did something like this: swfu.setPostParams({"PHPSESSID": swfu.settings.post_params.PHPSESSID, "tutorial": tutorial, "step": nr}); (this is a tutorial editor and i want to know to which step the file belongs to) The postparams in the DOM is changed, but I ca...

Permission denied to get property Window.startLoad

All of a sudden, this doesn't work for me: <script type="text/javascript"> window.opener.startLoad(); self.close(); </script> I get the following from firebug. Permission denied to get property Window.startLoad [Break on this error] window.opener.startLoad(); I am not even sure why it says properly "Window.startLoad" since "startLo...

Firefox textarea typing causing screen shaking (firefox2 winXP)

EDIT: Firefox 2 windows XP Steps to reproduce problem: Firefox 2 and visit: http://resopollution.com/rentfox/html/property_setup.html Begin Typing and pressing [enter key] to create new lines After about 10 [enter key] presses you'll notice the screen shaking How this happened This began happening after I installed a plugin for jQ...

Zend Framework - Passing a variable within a controller for an ajax call

Hi out there in Stackland! Here's my problem: I want to use my Zend controller to load an array from a database, and then pass it to javascript. I've decided the best way to do this is to use ajax to ask the controller for it's array, encode it in json, and then pass it down. However, I don't know how to pass the variable I loaded in...

Javascript menu not working in IE8

Website is available at http://danrowley.net/backstop_sandbox/ The drop-down menu doesn't stay open when you go to mouse over it. Javascript is: var DDSPEED = 10; var DDTIMER = 15; // main function to handle the mouse events // function ddMenu(id,d){ var h = document.getElementById(id + '-ddheader'); var c = document.getElement...

Loading Flash when debugging AIR

I'm trying to create an Adobe AIR widget with a Flash menu. The Flash menu was created in SWiSH Max2, exported as SWF9 with SWF6 properties exposed. The menu works, FSCommand works, and the attached JavaScript work (at least in Firefox). However, when I try to test this in the AIR Debug Launcher (ADL), nothing happens. I've used SWFO...

Mootools Periodical Problems

I am having trouble getting a class function to run periodically with mootools. It runs one fine, but then I get a function is undefined error. The related code can be seen here: http://gist.github.com/142298 ...

How can I stop a video with Javascript in Youtube?

Situation: here, where I pressed some video. Problem: I try to stop the video by Javascript in the console of Firebug: player.stopVideo(playerid):Void [1] [2] Question: Why does not the command above work? [1] Source for the part "player.stopVideo():Void" [2] I looked playerid with Firebug from the source. ...

console.log does not print undefined ?

Hi, I am new to Javascript. I am trying to understand where "this" is bound to using different examples. I am using console.log to print some values as shown below. function FuncObject(value) { this.answer = value; this.get_answer = function () { return this.answer; } }; var f = new FuncObject(42); var fanswer = ...

When should you use === vs ==, !== vs !=, etc.. in javascript?

Possible Duplicate: Javascript === vs == : Does it matter which equal operator I use? What are the differences between === and ==, !== and ==... when should you use one and when should you use the other? Matt ...

MVC view testing javascript with Visual Studio

I have MVC view with javascript. What would be the best way to test my view? ...

Printing the contents of a URL - javascript

I have a php page which has a chart, a date picker(calendar) and a few buttons. I want to add another button "Print Chart" which ONLY prints the chart & not the entire page ,in a local printer. I am trying to do this by a having another script(which only outputs a chart) and using the javascript function 'window.print' html <input t...

How does one return data to the original caller function in Javascript?

I have a problem returning data back to the function I want it returned to. Code below: function ioServer(request_data, callback) { $.ajax({ cache: false, data: "request=" + request_data, dataType: "json", error: function(XMLHttpRequest, textStatus, errorThrown){}, success: function(response_d...

What is array literal notation in javascript and when should you use it?

JSLint is giving me this error: Problem at line 11 character 33: Use the array literal notation []. var myArray = new Array(); What is array literal notation and why does it want me to use it instead? It shows here that new Array(); should work fine... is there something I'm missing? ...

Giving a function within a class method of a PrototypeJS Class access to class members

Let's say I have a very simple PrototypeJS class that looks like this: var Foo = Class.create({ initialize: function() { this.bar = 'bar'; }, dostuff: function() { $$('.enabled').each( function(elem) { alert(this.bar); //FAIL }); } }); This fails because the function being passed to .each() doesn't have a...

Javascript useragent grid?

Does anyone know of an existing browser/OS useragent string grid? It's hard to test, and I would really like a broad sampling of useragent strings, if possible. If no such grid exists, mind posting your useragent string? Given the idiosyncrocies of the browser/operating system combinations, this information is essential for successful w...