javascript

Running Google Analytics in iframe?

Our company runs a web site (oursite.com) with affiliate partners who send us traffic. In some cases, we set up our affiliates with their own subdomain (affiliate.oursite.com), and they display selected content from our site on their site (affiliate.com) using an iframe. Example of a page on their site: <html> <head></head> <body> <ifr...

Ext.form.FormPanel and form submission

Hello. I've been trying to submit a form with the FormPanel using the Action class Ext defaults to. However, I'd like it to consider the response as a script, not JSON-encoded. Has anyone had any experience on this? ...

Problems using jeditable and autogrow

I work on a Webproject using jQuery and CakePHP. I use jeditable as an inplace edit plugin. For textareas I extend it using the autogrow plugin. Well, I have two problems with this: First, autogrow does only work on Firefox, not on IE, Safari, Opera and Chrome. Second, I need a callback event for jeditable, when its finished showing t...

middle click (new tabs) and javascript links

Hi everyone, I am in charge of a website at work and recently I have added ajaxy requests to make it faster and more responsive. But it has raised an issue. On my pages, there is an index table on the left, like a menu. Once you have clicked on it, it makes a request that fills the rest of the page. At anytime you can click on another ...

Microsoft JScript runtime error: 'this._postBackSettings.async' is null or not an object

I have report on my asp page and every time I change a filter and click view report, I get this error: Microsoft JScript runtime error: 'this._postBackSettings.async' is null or not an object I tried change the EnablePartialRendering="true" to EnablePartialRendering="false" but then people can't login on the site ...

Is there a way to print all methods of an object in javascript?

Is there a way to print all methods of an object in javascript? ...

How to detect a click outside an element?

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area. Is something like this possible with jQuery? $("#menuscontainer").clickOutsideThisElement(function() { // hide the menus }); ...

ASP.NET MVC Client Side Validation

I am all about using ASP.NET MVC, but one of the areas that I hope gets improved on is Client-Side Validation. I know the most recent version (Preview 5) has a lot of new features for Validation, but they all seem to be after the page has been posted. I have seen an interesting article by Steve Sanderson... using Live Validation, Castl...

Any ideas on how to make edit-in-place degradable?

I'm currently writing an edit-in-place script for MooTools and I'm a little stumped as to how I can make it degrade gracefully without JavaScript while still having some functionality. I would like to use progressive enhancement in some way. I'm not looking for code, but more a concept as to how one would approach the situation. If you h...

Resizing an iframe based on content

I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes. How do I resize the iframes to fit the height of the iframes' content? I've tried to decipher the javascript Google uses but it's obfuscated, and searching the web has been fruitless so far. Update: Please note that...

Javascript String concatenation faster than this example?

Hello, I have to concatenate a bunch of Strings in Javascript and am searching for the fastest way to do so. Let's assume that the Javascript has to create a large XML-"file" that, naturally, consists of many small Strings. So I came up with: var sbuffer = []; for (var idx=0; idx<10000; idx=idx+1) { sbuffer.push(‘<xmlta...

How do I make a JavaScript call to a WCF service hosted on a different domain?

We are designing a web application using ASP.NET and AJAX and we want to host our WCF Service Layer on a different website and make JavaScript calls to the Service Layer from our client pages. We understand that the browser will not allow AJAX calls to a different port or domain. What is the best way to architect a solution? We are co...

jQuery index selectors

I'm trying to place 4 of my image containers into a new pane, having a total of 16 images. The jQuery below is what I came up with to do it. The first pane comes out correctly with 4 images in it. But the second has 4 images, plus the 3rd pane. And the 3rd pane has 4 images plus the 4th pane. I don't know exactly why the nesting is ...

How can I call a javascript function from inside a method?

I am inside of... public class bgchange : IMapServerDropDownBoxAction { void IServerAction.ServerAction(ToolbarItemInfo info) { Some code... and after "some code" I want to trigger [WebMethod] public static void DoSome() { } Which triggers some javascript. Is this possible? Ok, switch methods here. I was able to ca...

Why is my javascript function sometimes "not defined"?

Problem: I call my javascript function, and sometimes I get the error 'myFunction is not defined'. But it is defined. For example. I'll occasionally get 'copyArray is not defined' even in this example: function copyArray( pa ) { var la = []; for (var i=0; i < pa.length; i++) la.push( pa[i] ); return la; } Function.p...

How do I reference the calling dom element in a jquery ajax success function?

I'm trying to modify the class of an element if an ajax call based on that element is successful <script type='text/javascript'> $("#a.toggle").click(function(e){ $.ajax({ url: '/changeItem.php', dataType: 'json', type: 'POST', success: function(data,text){ if(data.error=='') { if($(this).hasClass('class1')) { ...

Passing in a text to a javascript function that may have a single quote.

I have a link that I dynamically create which looks something like the following: <a onclick="Edit('value from a text column here')" href="javascript:void(null);">Edit</a> with the Edit function then taking the passed in value and putting it into a Yahoo Rich Text Editor. This works well except for when there is a single quote in the ...

What is the best way to check for an empty string in JavaScript?

I saw this thread, but I didn't see a JavaScript specific example. Is there a simple string.Empty in JavaScript, or is it just checking for "" ? ...

Typical pitfalls of cross-browser compatibility

What are the most common browser compatibility issues across the major desktop browsers? No dups please. Up-vote problems you've run into. I'm hoping for the list to self-sort. "IE sux" is not a pitfall, but a call for down-vote. [Edit] Yes, I know it's a poll - I'm not posting answers in this to gather points - I'm actually interested...

Changing embedded google videos src

Im trying to recreate the functionality on google video where you can access certain parts of a video by putting #1h1m1m in the url So i have an embedded google video and links to the right that i want to link to certain times in that video. I can do this with a page refresh but im trying ot do it via javascript so i don't have to. I ...