javascript

How to create a pop-up window (the good kind)

I need to make a pop-up window for users to log-in to my website from other websites. I need to use a pop-up window to show the user the address bar so that they know it is a secure login, and not a spoof. For example, if I used a floating iframe, websites could spoof my login window and record the user's login information. Thanks Ad...

Where can I find information about Javascript engine internals?

I'm looking for books / articles / papers on Javascript engine internals along the lines of the many reference works about the JVM internals, CLR internals, etc. I could (and likely will) look at the source code for JavaScriptCore and V8/Chromium, but if there's a book out there or some other "guided tour" documentation, I'd prefer to r...

Is Firebug always correct at how it lists downloads with the Net tab?

Is it possible Firebug may be incorrectly adding downloads to the Net tab when things may be loaded from the cache? I have some code in a Javascript gallery which is meant to lazily download an image when the thumbnail is clicked and then display it once downloaded. It is meant to determine if it's been downloaded already first (via an ...

Server did not recognize the value of HTTP Header SOAPAction C# Javascript

[SoapRpcMethod(Action = "http://cyberindigo/TempWebService/InsertXML", RequestNamespace = "http://cyberindigo/TempWebService/Request", RequestElementName = "InsertXMLRequest", ResponseNamespace = "http://cyberindigo/TempWebService/Response", ResponseElementName = "InsertXMLResponse", Use = System.Web.Services.Descr...

Parsing JSON using JQuery

I have a JSON as follows { columns : [RULE_ID,COUNTRY_CODE], RULE_ID : [1,2,3,7,9,101,102,103,104,105,106,4,5,100,30], COUNTRY_CODE : [US,US,CA,US,FR,GB,GB,UM,AF,AF,AL,CA,US,US,US] } I need to retrive the column names from the columns entry and then use it to search the rest of the entries using jquery. For example I ...

How can I set globals to JSLint to ignore for a whole set of files?

I'd like to run JSLint4Java as part of my build process. I have about 1000 JS files in a library, and don't really want to add a /*globals foo, bar, baz */ header to each of them -- especially since many of them are from an external library (Dojo). If I don't add the header, though, JSLint complains about the same five globals on ne...

JQuery $.ajax "async: false" bug?

Hi, I would appreciate your opinion/advice on the following Scenario HTML has PDF file nick name, back end has URL for each nick. The link URL is always download.php?what=%PDF_Nick% to ensure download for JS disabled clients. For JS enabled clients I do JQuery AJAX call and rewrite link URL from download.php?what=%PDF_Nick% to ht...

Inserting one element inside another in jQuery

EDIT: Apologies, this was caused by an unrelated error! Hi, I'm trying to figure out how to add one element inside another using jQuery. For example, if I have a list: <ul class="someList"> <li>One</li> <li>Two</li> </ul> ...and I run $("ul.someList").prepend("<li>Zero</li>"); then I will end up with this: <ul class="som...

Is there any way to modify query strings without breaking an ASP.Net postback?

From reading here and around the net, I'm close to assuming the answer is "no", but... Let's say I have an ASP.Net page that sometimes has a query string parameter. If the page has the query string parameter, I want to strip it off before, during, or after postback. The page already has a lot of client-side script (pure JavaScript and j...

Can I save page pictures directly from GreaseMonkey script

Can I save page pictures from GreaseMonkey script directly to my hard drive? Is the easiest way to do it - to setup my server and translate picture urls to it using GM_xmlhttpRequest ? ...

.NET Submit Fires Before Javascript onKeypress

Hello, I am trying to use onkeypress on an input type="text" control to fire off some javascript if the enter button is pressed. It works on most pages, but I also have some pages with custom .NET controls. The problem is that the .NET submit fires before the onkeypress. Does anybody have an insight on how to make onkeypress fire firs...

Building jQuery UI Plugins

Beyond the official documentation, are there any recommended resources for learning to build jQuery plugins. I'm particularly interested in building plugins for the UI libary. I've been looking at the source for some of the official ones, but I've found they all look quite different from each other. Many are not well commented and it i...

How do you handle busy icons in an AJAX site?

This question deals with concurrency issues, for suggestions on how to display a busy icon see this question: http://stackoverflow.com/questions/205631/javascript-loadingbusy-indicator-or-transparent-div-over-page-on-event-click When a user initiates an AJAX request on a page it's useful to show some kind of "working" or busy icon or pr...

Beginner: Javascript must be on header to run? Does the declaration order of the functions matter?

I have this function in my head: <head> window.onload = function(){ var x = new Array(0,2,3,4,5,6,7,8); var y = new Array(20,10,40,30,60,50,70,10); drawGraph(y,x); } </head> Can I declare the function drawGraph() somewhere in the body? Do I need to declare it before it is called? ...

Validate Radio Button Group Client Side

asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoRemoveProperty" Text="Remove Property from TIV" /> I was thinking about implementing a custom validator, and using a client javascript function to reference the radio button ids, (I'm using web forms, not mvc), something like.. if(document.getElementById(<%= rdoAddPro...

Is there a way to do a 'scoped' add() in jQuery?

The main jQuery method takes a second optional argument to provide context for the search. eg $(".setA", ancestorOfSetsA); However, the jQuery add() method does not accept this context argument. What I am trying to accomplish is: $(".setA", ancestorOfSetsA).add(".setB", ancestorOfSetsB); I am attempting this through a plugin that ...

Drawing in javascript with divs

In my quest to learn javascript (which seems to be my latest source of questions for SO these days) i've found this API for drawing http://www.c-point.com/javascript_vector_draw.htm Meanwhile I've been making some experiments with graphics, which tend to be heavy on the amount of stuff to draw. This guy is drawing with divs, every squar...

In Javascript, what is the difference between indexOf() and search()?

Being fairly new to Javascript, I'm unable to discern when to use each of these. Can anyone help clarify this for me? ...

Detecting divs as rendered in the window to implement Google-Reader-like auto-mark-as-read?

Hello, When using Google Reader and browsing RSS entries in the "Expanded" view, entries will automatically be marked as 'read' once a certain percentage of the div is visible on the screen (difficult to tell what percentage has to be visible in the case of Google Reader). So, as I scroll down line-by-line, the javascript code can deter...

jQuery UI: Best way to load HTML markup?

What's the best way to load HTML markup for a custom jQuery UI widget? So far, I've seen elements simply created using strings (i.e. $(...).wrap('<div></div>')) which is fine for something simple. However, this makes it extremely difficult to modify later for more complex elements. This seems like a fairly common problem, but I also kn...