javascript

how to invoke the file download window in javascript?

Hi all, I have got a PDF fle which i would like my users to download when they click on a button/link/image.Is this possible? Thank You ...

Setting style with javascript unexpected results

Hello, I am detecting browsers and trying to apply style, alert(BrowserDetect.browser); if(BrowserDetect.browser == "Opera") { document.getElementById(myBox).style.paddingTop = "5px"; } Alert Shows the browsers name accurately but why is the style not getting applied? ...

Multiple select validation

Hello all, I have a form in HTML, that has several select elements, what is the best way to make validation for them in such way that no two select elements can have same value, validation function should fire on select, so it can check are there any selects with the same option value if yes then alert something, can I get a explanation...

Why does Google unescape their Analytics tracking code?

Just getting off my JavaScript training wheels. Why does Google choose to unescape the document.write line in Part 1 below? Why don't they just write it like this? Maybe unescape is required for some older browser compatibility? document.write('<script src="' + gaJsHost + 'google-analytics.com/ga.js" type="text/javascript"></s...

Single Choice Dropdown

I am building a form to rank series of items. The user will read the item and select in a dropdown the rating from 1 to 20. All 20 items will be displayed at the same time. What is the best way to make sure that the user didn't select the same number for more than one choice? Then I would display an error message, "You've already ranked ...

General Purpose Progressbar in Django

I want to make a little web-frontend for copying (rsync) and encoding (ffmpeg) files for my Server using Django. And I want to keep track of the progress of the processes. I saw a few jquery-scripts, but they are designed to be used with uploads, and I don't know enough javascript to modify these scripts for my needs. I want to write a ...

Error at json: "missing ] after element list" or just "undefined"

Hello! I have a json like: {"156644":{ "name":"name1", "street":"street1", "city":"city1" "68656":{ "name":"name2 ", "street":"street2", "city":"city1" "388655":{ "name":"name3", "street":"street3", "city":"city1" "4564":{ "name":"name4", "street":"street...

Opening popups from AS3 using ExternalInterface in Safari

hi, I'm using this code to open a popup ExternalInterface.call("function () { window.open('" + url + "','" + title + "','" + options + "'); }"); for JavaScript people: calling ExternalInterface.call(string); from flash player lets the browser do eval(string)(); as this call is within a click handler, it even works perfectly with Fir...

Google Analytics to track FireFox extension use

I'm developing a Firefox extension and would like to track its use with google analytics, but I can't get it working. I've tried manually calling a funstion from ga.js, but that didn't work for some reason. No error was produced, but neither was any data collected. My last attempt was to have a website that just holds the tracking java...

complete jqGrid?

Please, can anyone tell me how to use jqGrid? I want to do edit, add & delete functionality. Also I want to show an image in the grid Please tell me, what can I do, and how can I do? ...

Convert javascript event to MochiKitEvent

does anyone know how to convert a normal javascript event to a mochikit wrapped event? cant seem to find how to do it anywhere... regards, P.V. Goddijn. ...

getElementById("bookmarksBarContent").appendChild(button) is interpreted as getElementById("PersonalToolbar").appendChild(button)

"At the moment you can't overlay an element without an ID, so you need to use DOM methods to tweak the element you need in a load handler." - Xul Overlays I'm trying! For record: Using the Javascript Shell means using Firefox -> Tools -> ExtensionDeveloper -> Javascript Shell -> enumerateWindows() -> chrome://browser/content/browser.xu...

Make table rows sortable with YUI

Currently I have a table similar to below: <table id="tbl"> <thead> <tr><th>Example Title</th><th>Title2</th></tr> </thead> <tbody id="tblbdy"> <tr><td>data1</td><td>data2</td></tr> </tbody> </table> I am using script.aculo.us currently with the code: Sortable.create('tblbdy', {tag: 'tr', ghosting: fa...

JavaScript-HTML: Create ComboBox with non-selectable items

I would like to create a ComboBox like you can see in the following image The Combo/Menu/List should allow some items to be bold (Main Categories), and to have "sub-categories" under each main category. The bold items should not be clickeable or selectable (I guess these items should have value="") ? Thanks ...

How to create my own JavaScript object?

How to create my own JavaScript object and how can I check whether my custom object is present in my page or not? What is the difference between JavaScript function calling using an ordinary JS file and creating a custom JavaScript object? For Example: We can check the Jquery object by using the following JavaScript code: if(window.Jq...

How can I give alert message with Ok and Cancel button within a dataset function?

How can I give alert message with Ok and Cancel button within dataset function. If ok proceed further else return in asp.net. ...

JavaScript Object Contains inherit Property

Hi everyone, I have a web page that when I try to create a JavaScript object in it using: var myVar = {}; The resulting object always contains an inherit property, this interferes with my code and doesn't happen except on this page only, anyone knows why? ...

Get values of a textbox changed by javascript

hi strange bug: i have an ajax datepicker added to a text box of my form. i submit the form.. and I could receive all values excepting those of the datepicker checkboxes. why is the .Text property empty of this elements? Thanks ...

the images can't view properly

i've created some js codes to scrolling images on the page, but cannot view all images. the problem happened on google chrome. is there any solution? I'm including the js code and css to this. data=[ [" images/img1.jpg"," Image1","pic01.jpg"], [" images/img2.jpg","Image2 ","pic02.jpg"], [" images/img3.jpg","Image3","pic03.jpg"], [" imag...

jQuery on the fly URL shortener

I'm looking for an on the fly URL shortener much like how tweetdeck works. I have found many jQuery and general javascript plugins that take a url and run it through a shortening service such as bit.ly when a button is pressed. However, I have not been able to find one that does it on the fly. My first question is does this already exist...