javascript

How to prevent the 'Save (image) as' dialog on Ctrl+click in Opera

I have to create an image gallery where user can select some images and then process them. The selection should be done via Ctrl+LeftClick of the mouse. It works well in FF and IE8, but when I Ctrl+click in Opera, new dialog "Save as" appears which causes saving the clicked image. How do I prevent opening the dialog in Opera? (it's prob...

jQuery Forms - Ajax and normal submit the same form

Hello, I have a confirm step in one of my pages. Desired action: user clicks 'submit' and an AJAX request is made that does the appropriate action and returns a confirm dialog user 'confirms' and then the form is submitted using a standard post. So for the first part I'm fine using the jQuery form plugin: $('form').ajaxForm(...opt...

setting a whole style string to an element from javascript (not individual style parameters)

I need to set an arbitrary style to a span via javascript. I know I can do things like: span.style.height="250px"; But I need to be able to insert a random full style definition from a template for example float:left; text-decoration:underline; cursor:pointer; color:blue; Is there a way to do that in Javascript? Something like e...

Javascript replace() with case-change

Is there an easy way to change the case of a matched string with javascript? Example String : <li>something</li> Regex : /<([\w]+)[^>]*>.*?<\/\1>/ And what I'd like to do is replace the match $1 to all capital letters (inside the replace if possible). I'm not entirely sure when $1 is a valid match and not a string -- '$1'.toUpperCas...

get template checkbox names

How to get the checkbox names when that form is loaded by html template. in Java Script? ...

Native Javascript method in GWT

I have a native Javascript method in one of my GWT Java classes, but I'm having trouble calling my Java methods from the native Javascript code. I tried to follow this as closely as I could, but I can't get it to work. I compiled it and ran it in Firefox, and the error console said "Error: this.lc is not a function". I tried changing all...

Firefox throwing a exception with HTML Canvas putImageData

So I was working on this little javascript experiment and I needed a widget to track the FPS of it. I ported a widget I've been using with Actionscript 3 to Javascript and it seems to be working fine with Chrome/Safari but on Firefox is throwing an exception. This is the experiment: Depth of Field This is the error: [Exception... "An...

Sys.Serialization.JavaScriptSerializer in AJAX autocomplete

hello, I have an ajax autocomplete on a page ASP.NET. This calls a method from a web service which returns some postal codes. public string[] GetNames(string prefixText, int count, String contextKey) { prefixText = prefixText.Trim(); XmlNodeList list; List<string> names = new List<string>(); if ((prefixText[0] >= '0') &...

HTML Tags stripped using tinyMCE

Latest version of tinyMCE is stripping my embed tags, and javascript when I use it. I tried setting the verify_html flag to false without any luck. Here is my config js for tinyMCE, can anyone see what I am doing wrong? Update: I am positive it is not a server side issue. I used a plain textarea without tinymce loaded and it worked perf...

How do a get buttons not to take the focus?

I want my (ExtJS) toolbar buttons not to grab the focus on the web page when they are clicked, but to do their "thing" while leaving the focus in the form that had it when they were clicked. How do I do that? ...

Page history - back button exists?

Is it possible check if there is a value for history.go(-1)? I know you can't access history.previous directly. I am trying to stay away from document.referrer because I know it can be blocked in some instances. Here is what I am trying to do. I have an error page, on this page I would like to either have a BACK button (if it's not the...

event.pageX - Use JQuery Event in a function not bound through JQuery?

I have a table, and when the user clicks on each cell, some details should appear in a small popup div that appears where the user clicked. I'm using JQuery, but not to bind the function to the onclick event. function detailPopup(cell, event, groupName, groupID, ...) { var newDiv = document.createElement("div"); newDiv.id = "detai...

What reference material exists for writing my own -vsdoc.js for JS Intellisense in VS2008?

I've got the vsdoc for jquery working in my project, but I'd also like to get intellisense for my own JS files - including the verbose <param>, <field>, and <returns> tags and so on. Where can I find a specification for the format of those comments, beyond the -vsdoc.js for jquery? ...

My HTML dropdown won't work in IE6

So I'm using an HTML select box with a list of countries and a button to open a small window with more details for the selected item in the HTML select box. Here's how I'm doing this (I apologize in advance for any noobishness here, I'm still pretty new to Javascript): //in header <script type="text/javascript"> function popUp() { ...

Hide Javascript/CSS in Adobe AIR application deliverable

I've created an Adobe Air application that, when installed, will distribute the Javascript and CSS in the same readable format it was built with. This doesn't surprise me, but I was hoping that there would be some option that would have Air automatically obscure the source of the application for you upon installation. I know that I c...

Javascript - Nice way to create an array from an object array

I have a javascript object array: array = [ {x1, y1}, {x2, y2}, ... {xn, yn} ] I want to create a new array of just the x values: [ x1, x2, ... xn ] I could do this easily in a for loop...: var newarray = []; for (var i = 0; i < array.length; i++){ newarray.push(array[i].x); } ...but I'm wondering if there's a nice one line...

jquery, ajax and getting a complete html structure back.

I'm new to jquery and to some extent javascript programming. I've successfully started to use jquery for my ajax calls however I'm stumped and I'm sure this is a newbie question but here goes. I'm trying to return in an ajax call a complete html structure, to the point a table structure. However what keeps happening is that jquery eit...

jQuery nested XML question

I am using jQuery to insert an HTML shell into a page, and populate the shell with XML. Here is the XML in question <minorPropCategory title="Test Title 1"> <minorProp>FLV</minorProp> <minorProp>BLV</minorProp> <minorProp>RLV</minorProp> </minorPropCategory> <minorPropCategory title="Test Title 2"> <minorProp>LAS<...

Access the first property of an object

Is there an elegant way to access the first property of an object... where you don't know the name of your properties without using a loop like for .. in or jQuery's $.each For example, I need to access foo1 object without knowing the name of foo1: var example = { foo1: { /* stuff1 */}, foo2: { /* stuff2 */}, foo3: { /* ...

jQuery dynamic table live click plugin

I'm trying to write jquery-plugin for table. I have 2 dynamic tables from server: <div id="first_column"> <table> <tr id="f1"> <td class="select">some text</td> <td class="name">some name</td> </tr> <tr id="f2"> .... more same rows .... </tr> </table> </div> <div ...