javascript

Ext JS removeAll(false) behaviour

I have been using the following snippet of code in my app to drive a menu that contains different trees depending upon what is selected. It tries to create tree panels only once and to then reuse them if they are selected again, i.e. to keep the trees expanded state. var west = Ext.getCmp("west-panel"); west.removeAll(false); ...

When returning an object from a JavaScript constructor function (avoiding 'new') how do I implement public members?

I have begun writing my 'class' type JavaScript functions like the Module Pattern or Revealing Module patten. This avoids the use of 'new' and allows me to define which functions are public in a single place. However, I have been unable to see how to use and access public data members in this pattern. e.g. the member 'id' below is ac...

Accessing rails routes in javascript

Hi Can anyone explain how i can access the rails routes/names routes in javascript ? The following are some of the things i tried http://github.com/jsierles/js_named_routes. but no luck. ...

decoding an JSON array (from PHP) in Javascript (jQuery)

I first write the JSON: $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); print json_encode(array( "array" => $arr )); Then in the jQuery I do: j.post("notifications.php", {}, function(data){ Now this is where I'm a little confused, as I would normally do: data.array To get the data, but I'm not sure how to handle the array....

How to make synchronous AJAX calls in greasemonkey?

Hello, I have a list of URLs and need to load each page, one after another. This is my main function that i have in my Mind. mainFunction() { loop { // Loop through URL list oPage = func1(URL); //Get page contents aResult = func2(oPage); //Analyse the contents func3(aResult); //Do current page modifications } } func1 uses GM_xml...

Where am i going wrong - ajax

I have the following link- <a href="ex.com" onClick="return popitup2('<?php echo $var3; ?>');">Grab Coupon</a> Where i have initialized $var3 like this $var3 = "brand1,camp2"; The code for the function popitup2() is - <script language="javascript" type="text/javascript"> function popitup2(id) { $.ajax({ url: "http://jainkunal...

How do you get client-side script to execute on an ASP.NET postback? (from an UpdatePanel)

Basically I want to get some javascript to be sent back to the client and executed from a postback inside an UpdatePanel. Furthermore this is inside of a reusable WebControl. I've tried this.Page.ClientScript.RegisterStartupScript and this.Page.ClientScript.RegisterClientScriptBlock but Firebug shows that those scripts aren't sent back...

Table flashing or color change

I have 3 column table, I will need one of the columns to give me color change notification or flashing, how to do this? ...

Too large an AJAX response for mobile safari?

I am running into a bit of a problem in debugging a web application for mobile safari. The web app is a front-end for a fairly complex server-side simulation tool. The overview of how the web app works is: User is presented with a screen where they fill in values for the simulation to be performed. User clicks "run simulation" at whi...

RaphaelJS Chart Woes

I've been playing with Raphael trying to create a combination of two of his example charts. The first being http://raphaeljs.com/analytics.html which I have working properly, now I'm adding in some elements from http://raphaeljs.com/chart.html as my chart will be a monthly report. I have the forward/back buttons drawing correctly at th...

What does _gaq || [] accomplish for Google Analytics Ecommerce tracking?

Possible Duplicate: whats the javascript var _gaq = _gaq || []; for ? In the asynchronous example of Google Analytic's Ecommerce tracking code, the declaration of the array is: var _gaq = _gaq || []; I'm trying to understand what they are doing here. Is this a true OR statement? Is this because of the async treatment of t...

A website with 3 horizontally positioned images, which can be scrolled, and are lazy loaded (Explanation needed).

I don't know if I'm intruding too much in a person's code. This website uses jQuery Tool's Scrollable in big images (3 horizontally positioned images each time). But these images are only loaded when the previous one is clicked. Can anyone explain to me the code that does that?: Reference: index.php <div class="item current" title="...

How to combine JSF togglePanel to trigger visibility of some other div/element/?

I was looking through a number of websites, but i couldn't find out how to use a toggle panel to change the visibility of another element. Please see the example.. <rich:togglePanel switchType="client" stateOrder="panelOneOff, panelOneOn"> <f:facet name="panelOneOff"> <rich:toggleControl> <h:outputText value=...

Moving the javascript code to design view is not working. Only code-behind Attributes.Add("onclick" works. Puzzled

I wanted to disable a button after it is clicked and at the same time fire the post back event to generate a report. My first set of code did not work because soon after the button is disabled the page won't submit/post back. here's the first set of code which was not implemented. the onclientclick calls a javascript function which has t...

How to suppress Script error warnings when using TWebBrowser in Delphi?

Possible Duplicate: how to disable javascript errors on twebbrowser ? I'm using the TWebBrowser component with Delphi 6.0 to display a YouTube web page. Sometimes I get a Script error message box from Internet Explorer, which TWebBrowser embeds, complaining that an error has occurred in a script running on the page and prompt...

Runtime error in IE 6

I am getting runtime error in IE 6 for below code. function loadFromPopup(url) { if (top.opener){ top.opener.window.location.href = url; window.close(); return false; } return true; } Really appreciate if any one can give some suggestions. ...

Safari: Prevent two print dialogs when printing an Iframe

My site has a "print this page" button. I load a static print template HTML file into a hidden iframe, copy the HTML into that page using jQuery, and call window.print() from the Iframe page. All is well, except on Safari, which wants to print the parent frame as well, so I get two print dialogs opening. I've tried calling window.print...

Javascript widget inspired by iPhone UITableView?

Cocoa Touch's UITableView allows a user to scroll through large numbers of data rows with good performance because it recycles table rows. Rather than create a GUI element for every single data row, a limited number of table rows is created, and simply updated with the relevant data as the user scrolls, giving the illusion of navigating ...

How to properly unload/destroy a VIDEO element

I'm working on a realtime media browsing/playback application that uses <video> objects in the browser for playback, when available. I'm using a mix of straight javascript, and jQuery, My concern is specifically with memory. The application never reloads in the window, and the user can watch many videos, so memory management becomes ...

Can I disable a drop down list without using disable in javascript?

I have a drop down list that gets enabled/disabled based on a checkbox onclick. On my debugging my object reference is not set when my checkbox is disabled in my controller. CONTROLLER Subject = Request.Form["DetailSelect" + rowID].ToString(); JAVASCRIPT ddlSelect.disabled = !ddlSelect.disabled; ASPX <select = i...