javascript

TabContainer paging using javascript and update panels

Hello, I am trying to create a Ajax Toolkit TabContainer which has Previous and Next links on each tab. I have added update panels to each tab container in an attempt to get from one tab to the next without postback. With the code show below, a page reload is NOT being fired as I click tab headers (GOOD), but it IS being fired when I cl...

jQuery Week Calendar overlapping problem

Hi, I'm developing an application with uses this calendar for resource reservation, but I have a problem when creating a new event. I don't want events to overlap, so I set allow allowCalEventOverlap to false. However, it still overlaps in a transparent way. But the biggest problem is that I can't drag an event if there's another on t...

Javascript - how to change elements content inside a page when using iframes, using dom, not jquery

Hello all, I have this iframe and as u can see it call a js function with the onload trigger. <iframe name="top" id="top" width="99%" height="20%" src="top.htm" frameborder="0" scrolling="no" onload="log_in()"></iframe> What i need to do is to effect the element inside "top.htm" (change innerHTML and stuff like that) from that functi...

Eclipse javascript character encoding

Hi, I'd like to display some language specific characters from javascript but I can't. My app is a Java webapp and the front end is jQuery. All the characters that are sended from the server - in a JSP or with AJAX - are displayed properly. When I want to display some text hardcoded in to the javascript file it's broken. I'm using Ecl...

AJAX UpdatePanel.Visible Property not working with Javascript

I have code below. I want to hide the update panel by using Javascript (without going to server) when the user clicks Hide button. Although javascript funciton seems to be working fine in debugging, it does not hide! <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <script type=...

Effect.toggle and AJAX Calls

Hi, I am using the following code to capture all the AJAX calls being made from my app, in order to show a busy spinner till the call is completed. It works well when the requests are well spaced out. However, when the request are made in quick successions, some of the AJAX calls do not get registered, or the onCreate and onComplete act...

Any Javascript optimization benchmarks?

I watched Nicholas Zakas' talk, Speed up your Javascript, with some interest. I liked how he benchmarked the various performance improvements created by various optimization techniques, e.g. reducing calls to deeply nested objects, changing loops to count down instead of up, etc. I would like to run these benchmarks myself though, to se...

How to pass a function as an argument in Javascript?

I'm looking to pass an anonymous function to another function, but it doesn't seem to be working as I'd like. I've attached the code, I think it'd give you a better idea what I'd to do. <script language="javascript" type="text/javascript"> function do_work(success) { success; } do_work(function () { alert("hello") }); </scrip...

How can I use a search button using JavaScript Triple Combo Box?

I am using this Cut & Paste Triple Combo script.. This does not have a search button next to it. How can I put a search button instead of direct select URL linking? Here is the double combo with Go button But the triple does not have a search button. How can I put a search button in that Triple Combo Script? Please provide all the cod...

How does the dispatch action call work in the Twitter sidebar

I would like to understand how the call for replies works as follows: <a href="http://twitter.com/replies" data="{"dispatch_action":"replies"}"> <span>@phwd</span> </a> This was taken from the homepage of Twitter. The section in particular being: data="{"dispatch_action":"replies"}" I believe (think), it is using Twitter's own twi...

Writing String into a File

I'm implementing a WebScript using Alfresco's JavaScript. l'm trying to insert string to a file, but I can't do it. When I write another file's content like: file.properties.content.write(content); It works, and the file's contents are copied into my file. But I can't insert string directly, like: file.properties.content.write("Stuf...

Passing in number, Number.prototype.format

I've seen this format function referenced on several sites, but none of them have an explicit example of how to pass in a number into the function. I've tried '12345'.format('0.00') which I believe is how it should be written, but it gives me the error that the object doesn't support the property or method. I've also tried Number('1234...

Array indexOf implementation for Internet Explorer

There are plenty of solutions on how to get the indexOf implementation into the Array prototype so that it works under Internet Explorer, however I've stumbled upon an issue that doesn't seem to be addressed anywhere I've looked so far. Using the pretty well agreed upon implementation at MDC, I have the following code that's being probl...

Validate a string

I'm not that good with regular expressions... I need a JavaScript regular expression that will do the following: The string can contain letters (upper and lower case), but not punctuations such as éàïç... The string can contain numbers (0..9) anywhere in the string, except on the first position. The string can contain underscores (_)....

Array construction and negative numbers

I was implementing a routing algorithm in javascript, but when I assign a negative one variable in the array gives me this error: invalid array length. var node = new Array() node[0] = new Array(6,7) node[1] = new Array(5,-4,8) node[2] = new Array(-2) //Here, invalid array length I do not know how to resolve this error. ...

How do I create a reply button for a Twitter client that automatically fills in a username in the 'tweet' form?

Using the Twitter API, and just want to have a simple 'reply' button on every tweet (say, 'How do I create a reply button?' from @kraykray) that automatically puts '@kraykray' into the tweet form. Don't need the system to log that it's any kind of special message. ...

Can YUIs DataTable do inline cell editing with auto completion?

I'm trying to get YUIs DataTable to work using Inline Cell Editing that can Auto Complete. In this thread: http://yuilibrary.com/projects/yui2/ticket/2528064 Somebody provides a non-working solution, that seems close. Has anybody tried to get this to work? ...

How do I run JavaScript in my ContentPlaceHolder?

I had a load of javascript that ran well when everything was in one page. Now that I've separated it out, I'm not sure how to include the javascript, ssing the HEAD tag in in the master, and also, I had functions that ran when the body loaded but they are in the master too. By the way this is a .NET 2.0 app. ...

.split("1px") into ["1px",1,"px"] in Javascript

I'm rubbish at Regular Expressions, really! What I'd like is to split a string containing a CSS property value into an array of [string,value,unit]. For example: if I supplied the .split() method with 1px it'd return ["1px",1,"px"]. If I were to supply, similarly, 10% it'd return ["10%",10,"%"]. Can this be done? I appreciate all you...

Can JQuery/JavaScript be used to write a substantial client side application?

I have an unusual situation - I have an embedded video streaming device with a complicated UI, and I need to use an embedded web server to reproduce that UI through a web browser. I'm thinking of using JavaScript/JQuery on a C++ backend (I am NOT coding all this myself, I need to hire people for the grunt work). The embedded web server...