javascript

google analytics js file cached but utm.gif still loaded

Hi, I use google analytics which uses a file ga.js. This creates a hidden utm.gif file in which parameters are attached and sent to a server (to be included in the google analytics interface) My understanding is that utm.gif uses a "304 not modified" header, to ensure that the file is always reloaded (rather than cached). In this case...

javascript: recursive anonymous function?

Lets say I have a basic recursive function: function recur(data) { data = data+1; var nothing = function() { recur(data); } nothing(); } How could I do this if I have an anonymous function such as... (function(data){ data = data+1; var nothing = function() { //Something here that calls the func...

Is it possible to create a SOAP API using C# and JavaScript

I am looking to create a SOAP API using C# which I can then call using JavaScript. I use C# regularly but do not have any experience with creating API's. I would like to call the API using JavaScript as this will be used to submit form data from multiple websites not maintained by us. If there is a better solution than SOAP I am open ...

How can I produce a satellite image using a set of coordinates in Google Maps' javascript API?

I'd like to populate the infoWindow of an annotation with an image of the location the pin is on dynamically, producing an aerial photo and stuffing it into the infoWindow. This is what I have now, but it means I have to have an image for each site ready to go in advance, which is a lot of provisioning work for several hundred different...

Ruby use case for nil, equivalent to Python None or JavaScript undefined

How does Ruby's nil manifest in code? For example, in Python you might use None for a default argument when it refers to another argument, but in Ruby you can refer to other arguments in the arg list (see this question). In JS, undefined pops up even more because you can't specify default arguments at all. Can you give an example of how ...

Target tabs within tabs with #hash URL (or otherwise)

I am using the jQuery Tools library Tabs. You can find them here: http://flowplayer.org/tools/tabs/index.html My basic markup is something like this: $("#tab-holder ul").tabs("div.tab", { history: true, api: true }) $("#profile-sub-tabs ul.menu").tabs("div"); The #profile-sub-tabs is another tab interface within the main #tab-holder ...

dice up a string in JS

I have a string like this 4741:GREEN,CIRHOSIS,ORANGE,Long-term,GREEN,HIS B CHIC,4642:GREEN,CRHOSIS,GREEN,HSysk B CC, the sting contains two records with record ID 4741 and 4642 separated by character. Also within the records everything else is separated by comma(,) how can I split this sting. Please note that this example string con...

Silverlight window.external.notify() securityproblem?

Hi, in my silverlight application I am using the webBrowser control. I call following javascript function on the page i'm navigating to. function notify() { window.external.notify("Close"); } The weird fact is that it only works when I am navigating to the page by using: this.Browser.Source = new Uri("http://local...

Preloading comboboxes in Ext

In a form I need to select a couple of nested resources. For that I hava a couple of comboboxes that depend on each other, i.e when a value has been selected in one the request-url of an other is modified and I call getStore().load() on it. I have a problem here though: Either I let the comboboxes have mode: "remote" in which case they ...

Sliding box with caption

I have a sliding boxcaption and it works fine. But when you first view it has the box caption over it and then when you mouse over it works properly but it starts off with the caption on top. And I want the box caption only to show when the user mouses over the box. I cant figure out why it does that. It's kind of odd. Take a look at i...

How to move and resize the browser's window in Opera and Chrome?

I was looking for a way to resize and move the browser's window and I've found it: self.resizeTo(w, h) and self.moveTo(x, y) - this seems to work perfectly, but only in Firefox and IE (tested with IE8, don't know how does it work in the previous versions). How can I force the same behavior (resizing and moving) in Opera and Chrome? In th...

Using jQuery in place of document.getElement

I would like to use $("#fooid") in place of document.getElementById("fooid") because I'm getting the id with the # in front of it. While you can remove it easily enough, there is a fair amount of intermixing between when I'm using a jQuery selector and when I'm using native DOM calls. In particular this is being called inside a cha...

Problem with newline in JavaScript regexp

Hi, i tried to do not show "SPAM" in string below using that regex: alert("{SPAM\nSPAM} _1_ {SPAM} _2_".replace(/{[\s\S]+}/gm, "")); What i was supposed to see was "~1~ ~2~" (or something like that) but i got just ~2~. Why? ...

How to force ExtJS to consider value in grid cell changed after custom editing completes?

Hi, I have an ExtJS EditorGridPanel with several columns. One of the columns is bound to a complex data type (an array of objects), and uses a custom editor to modify those values in a pop-up window. That part is tested and all works fine - the JsonStore is keeping the complex values, setting the custom editor's value when it's focuse...

Connect with Facebook buttons - how does the pop-up window work?

Does anyone know how facebook connect buttons generate the pop-up window that you use to sign in? I would think that there's a code like this.. <a href="#" onClick="MyWindow=window.open('http://www.yahoo.com','MyWindow','toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,width=600,height=300'); retu...

HTML file upload: is there a way to force content-type="application/octet-stream"

Hello, We are custom handling file uploads on the server end due to embedded limitations. The HTML file upload code used in a Firefox browser: <html> <body> <form action="http:///192.168.1.1/upload.cgi" name="form_1" method="post" enctype="multipart/form-data" > <input type="file" id="file" name="filename" content-type="ap...

What does the function then() mean in JavaScript

I've been seeing code that looks like: myObj.doSome("task").then(function(env) { // logic }); Where does then() come from? ...

Help in jquery validation.

I am using jquery validation plugin to validate my form on client side. I am adding a new method using addMethod function for every HTML control which have regex (custom) attribute. My HTML control would look like. <input type="text" id="txtInf" name="txtInf" regex="some regular exp" error="check your inf"></input> $("*[regex]").each(...

Facebook via iphone without using an iphone...

How can i trick my wall post using an application or any to trick my wall post so it say 11hours ago via iphone for facebook.It looks so cool... ...

Hack Javascript Definitions for "undefined" objects.

Hey, so I'm not entirely sure this is possible, but I am curious if it is possible to hack the definitions of "undefined" objects. Primarily, the purpose of this is to prevent errors from launching when doing a .replace on an object that is undefined. Is it possible to go into the "back end" (is there even such a thing??) and add a met...