javascript

Is it possible to compute a file's SHA1 ID using Javascript?

If this were possible to do prior to posting a form, it may save me having to upload the file to my server... ...

YUI stopEvent not working

I am trying to prevent JavaScript events from continuing to propagate, using YUI. The following is some minimal HTML and some minimal JavaScript which demonstrates the problem: HTML: <a href="#foo" onClick="fooClickTest()" id="foo">foo</a>&nbsp; <a href="#bar" id="bar">bar</a>&nbsp; JavaScript: function fooClickTest(e) { alert(...

ClientID inside of ASCX file

So I am trying to get CLientID inside the .ascx (user control mark-up) file. While this My id is: <%=this.ClientID%> renders as My id is: fracTemplateCtrl This: <asp:Button ID="btnSave" runat="server" Text="Save Template" onclick="btnSave_Click" OnClientClick="return confirmSave('<%=this.ClientID%>');" /> renders as (i...

-webkit-transition-property receives unexpected values in Safari 3.1.2 (Windows)

I am developing an iPhone-optimized website and testing it on Safari 3.1.2 on Windows. For some elements in the website I am applying implicit animation using -webkit-transition style. So basically, I have elements like this: <div style="-webkit-transition: left 2s linear;">...</div> that sometimes are present in the document from th...

Which JavaScript graphics library has the best performance?

I'm doing some research for a JavaScript project where the performance of drawing simple primitives (i.e. lines) is by far the top priority. The answers to this question provide a great list of JS graphics libraries. While I realize that the choice of browser has a greater impact than the library, I'd like to know whether there are a...

What is the correct syntax to represent subobjects in JSON?

I have a simple object that is deserialized from JSON into a server-side object. JSON: { name : 'ObjectName', host : 'http://localhost', ImagesPath : '/Images/' } On the server side, the above JSON code gets deserialized into this C# object via System.Web.Script.Serialization.JavaScriptSeriali...

Refreshing div (cause browse to redraw it)

In a web application I'm hitting some troubles with dynamic content - where by a form being hidden or shown above a jquery ui tab control causes rendering issues until the user hovers there mouse over the tabs, which then causes the tab header to redraw in the correct location. It's only occuring in IE7 and as a quick hack I'm doing thi...

Server polling intervals for a javascript chat client

I'm building a basic little AJAX shoutbox/chat for my website, but I'm not sure exactly how to implement the server polling. Here's the basic program flow I'm thinking of: User comes to page and is shown the last 10 messages To get messages sent by others, the client javascript would request a URL with a timestamp parameter (set to th...

Drop Files From Window To Javascript

I am sure it's possible to be able to drag files onto a Flash movie inside a browser, but is it possible to achieve the same functionality with Javascript? I have seen a site (can't remember) that did this, but I never checked if it was a pure Javascript solution compared to a Flash solution. I am leaning towards the not side, I believ...

Temporary file name with js

Is it possible to get temporary filename with javascript? I want upload a file using ajax... So, i want to get the tmp filename with js. Is this possible? ...

creating something like pageflakes

anyone know of a tutorial that lets you create something like pageflakes.com for your website? in jquery perhaps? ...

Deep cloning vs setting of innerHTML: what's faster?

I'm trying to figure out the most performant way of deep-cloning a DOM tree within the browser. If I start out with var div = document.getElementById("source"); var markup = div.innerHTML; What will be faster, var target = div.cloneNode(true); or var target = document.cloneNode(false); target.innerHTML = markup; I understand th...

What is best practice to handle javascript and css files

How do You manage all of Your .js and .css files in asp.net project. Especially when they have a lot of dependency between each other? I've combined all script in one. But it's become weighty, and 90% of them were not used on particular pages. What I want is an instrument or guidence to manage all of those scripts, simple dependency ma...

how to tokenize/parse string literals from javascript source code

I am working on a program in C# that needs to load some javascript code, parse it and do some processing to the string literals found in the code (such as overwrite them with something else). My problem is that I'm having a difficult time devising an elegant way to actually find the string literals in the javascript code in the first pl...

How to include an html page into an html page

Hi friends, I want to include an html page inside an html page. Is it possible? Please give me the code. I dont want to do it in PHP, I know that in PHP, we can use include for this situation, how can I achieve the same purely in html without using the iframe and frame concept? ...

Jquery Help : Draggable to Sortable and then back to draggable again.

I have a pool of items in the drag list which is connected to a sortable using connectToSortable option. Now I want to remove some items from this sort list and move them back to the drag list. Sort of like an undo. Suppose the user moves some 5 items to sort list and decides he/she wants only 4 items, and decides to just drag the unwant...

Best way to organise data

JavaScript takes a string of 4 hyphen delimited id's and string of 4 hyphen delimited titles and makes a request for JSON data to my C# web service. Then the C# web service makes a tracker with status "pending" and awaits the user to confirm the tracker before json can be served up on next request. When the user confirms the tracker th...

Scaling HTML layout to the screen size

Could you tell me how to fix a HTML layout automatically with the screen resolution? Example, I am coding HTML in screen resolution of 1024 by 768 pixels. If I switch to 800 by 600 pixels, I want my HTML windows changed automatically to fix the screen. How could I do that? ...

Changing data content on an Object Tag in HTML

I have an HTML page which contains an Object tag to host an embedded HTML page. <object style="border: none;" standby="loading" id="contentarea" width="100%" height="53%" type="text/html" data="test1.html"></object> However, I need to be to change the HTML page within the object tag. The current code seems to create a clone of the o...

Calling dynamic function with dynamic parameters in Javascript

Hi all, I'm looking for a trick about this. I know how to call a dynamic, arbitrary function in Javascript, passing specific parameters, something like this: function mainfunc (func, par1, par2){ window[func](par1, par2); } function calledfunc(par1, par2){ // Do stuff here } mainfunc('calledfunc','hello','bye'); I know how ...