javascript

Ensuring unique Javascript identifiers in ASP.NET Web User Controls.

Hello, In my current project, I am creating a number of user controls, some of which include some custom Javascript for event handling on the client side. I am registering my event handlers using OnClientClick="function()" and the like. Now, I'm wondering how to ensure that all Javascript function names are unique for each specific ins...

Persist javascript variables between GET requests ?

ASP .NET is allowed Storing the values in hidden input fields is allowed Query String is not allowed POST request is not allowed It is possible to store JS variables between GET requests ? I want to reinitialize them on the client using ClientScript.RegisterStartupScript Can I use cookies for this ? Are there other posibilities? Where...

JQuery explanation on document.ready

Hello, I have question will the click event or any other event run in document.ready() for the first time? I mean will it reach after loading DOM elements to the comment without clicking first time? :) $(document).ready( $(#foo).click( function() { // "It reached here after DOM is loaded!" } ) ) ...

Diagrams in JavaScript

I'm trying to present two types of data as diagrams in my PHP based web application: cake diagram: showing different types of data for the current user, i.e. incidents and changes received by the user 2D bar diagram: showing basically the same data, but for several users (i.e. incidents for user a, user b and user c; changes for a, b, ...

Javascript InnerHTML in IE7 messing with INPUT tags

When I receive the innerHTML of an element containing an input[type=text] element the speech marks around the value and id are removed in IE7 i.e. <input type="text" id="test" value="test" /> Becomes: <input type="text" id=test value=test /> This would be fine, other than the fact that I am using a JQuery plugin that takes a html s...

(Javascript) Inserting elements dynamically in a specific position

Basically what I have is this: <body> <div class="class1"> </div> <div class="class2"> </div> <div class="class3"> </div> ... </body> I have no idea why the site creator used classes instead of IDs (they're unique), but it doesn't really matter as I'm writing a GM script and so getElementsByClassName('')[0] effectively does the ...

Determine when Flash SWF movie has ended with Javascript

How can I use javascript to determine when a Flash movie has ended? ie like an SWF "MovieEnded" event ...

ASP.Net dropdown control loses state after being set dynamically through javascript

I have an asp.net dropdownlist control. There are two ways it can be selected. The first is through a button that sets the value in the drop-down list via javascript. The second is by manually selecting the dropdownlist option. Each of these methods work by themselves. If I do the first followed by the second and then hit save - the ...

Error using double quotes in a string in javascript

I need to put this string in a variable: chart cid="20" but when I escape: \" this way: AddSettings = AddSettings + "chart cid=\"0\""; I still get a javascript error and the sentence shows up in the browser insted of get into the AddSetting variable. I also tried this way: AddSettings = AddSettings + 'chart cid="0"'; And the sa...

JavaScript + onunload event

I want to fire onunload event to do some clean up operations, I have multiple tabs(Navbar) showing multiple links to different web pages,my problem is that even when I'm in some other page my unload function which is in tag of some other jsp is fired. Please help to resove this, I want unload function to be called when user closes brow...

How to dynamically show/hide a facebook login button

How can I determine via javascript if a user has logged in to my site via facebook connect or not? Based on this result, I would like to show/not show a <fb:login-button> button on the site. If I did something like this using jquery: <div id="login"></div> <script> if (notLoggedIn) { $("#login").html("<fb:login-button></fb>"); } <...

Can I let PHP know that a user does not have javascript enabled?

Can I let PHP know that a user does not have javascript enabled? ...

How to set width of <div> to fit constant number of letters in monospace font?

I researched for a while, hasn't found a CSS solution yet, em and ex units are not correct in this case. What I want is simply a div box that exactly fits 80x25 monospace text. Do I have to resort to Javascript solutions? ...

Getting objects to stay in a scriptaculous droppable.

I found some interesting code when I was looking at things that people had added on to Scriptaculous, and I'm trying to modify it for my purposes. I got nearly all of it working, except when I paste in the drop handler code, my page stops loading. Here's the relevant snipits: For draggables: for (i=0; i<=50; i++){ Squad = 'Squad'...

How to add JS support to the Ruby Mechanize gem?

Hello, is there a way to add JavaScript support to mechanize so that it will handle simple redirection like "document.location.href="? TIA ...

Reuse browser's Acrobat Reader instance?

Acrobat Reader successfully renders sample1.pdf inside IE given the following HTML: <embed style="width: 8.5in; height: 11in;" id="pdfViewer" src="sample1.pdf" type="application/pdf"> What javascript allows me to use that same PDF reader instance to display sample2.pdf? EDIT: I don't care what HTML is involved, I don't think -- the g...

Functional jQuery: Custom Events or Functions?

Being new to functional programming, I was working on my application's javascript (using jQuery exclusively), and wondering how jQuery's event system relates to it's functional programming paradigm. I have a function setupAccountHeader that could easily be either a document-bound event like $(document).bind('setupAccountHeader', functi...

Updating ValidatorCallOut Error Message from Javascript

I am trying to update the error message for a CustomValidator that uses a ValidatorCallOut via javascript. Basically its checking to see if a number entered is an increment of a specified number. I have some code that will update the error message the first time it is run, but after that it will no longer update the error message, alth...

Href="#" Don't Scroll

Hey Guys, I am pretty new to JS - so just wondering whether you know how to solve this problem. Current I have in my code <a href='#' class="closeLink">close</a> Which runs some JS to close a box. The problem I have is that when the user clicks on the link - the href="#" takes the user to the top of page when this happens. How to s...

YUI Datatable & Large Data Sets w/o Pagination

I am currently implementing a YUI datatable as a reusable viewer to show sales reports (and other such things) for internal use. The problem is, many of these reports are up to, and even more than 1000 rows long, and client-side performance becomes an issue on even newer, faster machines. For a variety of reasons, server-side pagination...