javascript

Firefox Addons: Unable to open new page in document.popup.

Hi, I have a firefox addon which opens a document.popup window. When I click a link within the popup, I want to call a javascript function which displays an alert within the popup itself. When I try onCLick(onY()); the alert comes only after I close the popup. '<div id="SearchLiteDef-yahoo" style="'+ 'font-family:arial; fon...

how to add row dynamically in html using javascript

Hi experts, I have a task where I need to add a table row dynamically in HTML where each row has 2 textboxes and the last element is a hyperlink. However, when I add a row the last element hyperlink should be replace by an <input> tag. How this can be done? I I'm able to add a row but I'm unable to change the last element to <input> tag...

getting data using javascript

how can I get this exchange rates from a web service using htm and javascript? Dictionary Türkiye = Turkey | Dünya = World | Son güncellenme = Last updating date ...

Setting a select value

Hey all, Is there any way to set the value of a select and have it act as if it was changed by the user? I used $(document).ready(function(){ $('#department').change(function(){ $('#academicbody').hide(); var selected = $("#department :selected").val(); $('#progrmmehome').load('/email/programmelist/'+selecte...

Why doesn't indexOf work on an array IE8?

The below function works fine on opera, firefox and chrome. However in IE8 it fails on if ( allowed.indexOf(ext[1]) == -1) part. Does anyone know why? Is there any obvious mistake? function CheckMe() { var allowed = new Array('docx','xls','xlsx', 'mp3', 'mp4', '3gp', 'sis', 'sisx', 'mp3', 'wav', 'mid', 'amr', 'jpg', 'gif', 'png', '...

Double Service Call on Cached Dojox Grid

Hello, I am trying to get the amount of rows returned from a ServiceStore call. I am caching the Grid, so I should be able to return the amount of rows with a store.fetch, for some reason store.fetch is making another service call. Here is a code snippet grid = new dojox.grid.DataGrid({ structure:gri...

Javascript loses communication with flash when moved inside dom.

Code inside Actionscript: var methodName4:String = "startupload"; var instance4:Object = null; var method4:Function = startupload; var wasSuccessful4:Boolean = ExternalInterface.addCallback(methodName4, instance4, method4); function startupload(currently_uploading_id) { /* If there is still more photos to upload, then proceed to ne...

Why does this javascript (jquery) function seem to run out of order?

I'm having a nightmare with a simple function! I want it to: read the height of a div with existing content in it Update the div with the new content (supplied to the function) Read the height the div should be, but set it to the original height. Animate the div's height to adjust and fit the new content. Code is as follows: // fun...

Sorting items in JQuery on a variety of attributes ...

I need to give users the functionality to sort a list of products based on several pre-selected field names. The products list is structured roughly like ... <span class="productList"> <div class="product"> <p><strong class="sortName">Title</strong></p> <p>Weight: <span class="sortWeight">3.50</span> pounds</p> <p>Price: <span ...

show flash using original canvas size dimensions

I have a generalized media player web app that I wish to be able to use flash in. The client uploads the flash to a particular directory, and a webpage is produced automatically that houses that flash file. The output of this process currently looks something like this: <OBJECT id="flashContent" classid="clsid:D27CDB6E-AE6D-11cf-96B8-4...

update filename in a url with jquery

Wonder how I could do the following wit jquery - I have a url pointing to an image -> http://www.website.com/folder/folder2/image_current.jpg (this value is stored in a variable) I have variable that holds the value -> new_image.jpg How can I with jquery update the full url (held in the variable) from http://www.website.com/folder/f...

Efficiently loading hidden/layered images in web page

I have a layered div component which displays a successive series of large kb images by slide-animating away the top image to reveal the next image below. I'm trying to understand how best to approach this. Approach 1: layer a number of divs on top of each other, each with an image assigned as background, and slide away the divs as ne...

javascript error in IE 8

This is throwing a js error in ie8, FF is good. any ideas? This is line 1340 var cc_meth_cookie =$.cookie("cc_method"); This is line 1339 just in case... $(Choose_PaymentMethodType(1)); Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET...

Is there a way for a Content Editor Web Part to query like a Query Web Part?

I have a Content Editor Web Part where I am using scrolling Javascript to display text. I need to query my news section with all its articles while maintaining the scrolling. I know I can hard code the links, but I would like to not have to enter a new link every time a manager adds news. Is it possible to do this? Or on the other en...

display HTML page after loading complete

Is there a way to force the browser to display a page only after all of the page's contents are completely loaded (such as images, scripts, css, etc)? ...

How is Node.js inherently faster when it still relies on Threads internally?

Hey all, I just watched the following video: Introduction to Node.js and still don't understand how you get the speed benefits. Mainly, at one point Ryan Dahl (Node.js' creator) says that Node.js is event-loop based instead of thread-based. Threads are expensive and should only be left to the experts of concurrent programming to be ut...

Getting an union of two arrays in jQuery

Say I have an array of [34,35,45,48,49] and another array of [48,55]. How can I get a resulting array of [34,35,45,48,49,55]? ...

how to use variable instead of constants

how to use variable i in place of '1.4'.i want to use variable i to zoom out and zoom in the webview. [tp stringByEvaluatingJavaScriptFromString:@"document.body.style.zoom = '1.4';"]; Thanks in advance ...

jQuery Ajax: Can i store more than one "variable" on success?

Hey. Basically it's just: success: function(msg){ alert(msg); } What comes out alert´s. But is it possible for me if i have a var in the file that the ajax call: $filename = time() . "10"; to use in success? So i could do success: function(msg){ alert($filename); } (now its not correct) but how can i do this? $.ajax({ ...

custom validation with jsvalidate

I'm using jsvalidate and I want to require some fields only when the user selects a yes (Sí) on my form here: A required validation field on jsvalidate is implemented writing class="jsquerired" on the select element. How can I make class="jsquerired" appear if the user clicks "Sí" on my select? Example:<input class="jsrequired jsvalid...