javascript

JS doc with ant

I am trying to get ant to run my jsdoc toolkit. After I create my build.xml from the examples at the site, I end up with this: <taskdef name="jsdoctoolkit" classname="uk.co.darrenhurley.ant.tasks.JsDocToolkit" classpath="/jsdoc/jsrun.jar;/jsdoc/java/classes/js.jar"/> As I run #ant I get the following error: /pathto/jsdoc_toolkit-2...

performing jQuery show/hide on dynamically created content

I have a page I created with jQuery, and in this page is a table where the table rows have classnames that identify them as a certain color (i.e. tr class="yellowclass"). The user is able to filter rows by clicking a checkbox that will show/hide tables of a certain color. My problem is that the table is generated on the fly via getJS...

Browser Tab/Window tracking pattern?

Is there an accepted pattern for tracking that a page is being loaded by the same tab/window? There are certain processes (like stepped submission processes), which can greatly benefit from a ability to verify that the same tab is asking for execution. For example, there are places where (between steps) we store intermediate data in me...

Make div stick to the bottom of container div

I'd like a div (#menu) to be fixed with its bottom edge to the bottom edge of its container (#cont). Normally this is easy with absolute positioning, but I want #cont to stretch to the size of #menu. Then why does it matter if it sticks to the top or bottom, you wonder? I use the jQuery slideUp effect which vertically shrinks #cont in a...

Using jQuery, a Dropdownlist should only be visible if at least 1 checkbox is selected

I have links that when clicked, select all the checkboxes or deselect them. I also have a dropdown list that I want to be made visible only if at least one of the checkboxes are selected. What is the best way to do this? Should I write login inside the code that selects/deleselects them or is there a better way to do this? ...

Relative Paths in Javascript in an external file

So I'm running this javascript, and everything works fine, except the paths to the background image. It works on my local ASP.NET Dev environment, but it does NOT work when deployed to a server in a virtual directory. This is in an external .js file, folder structure is Site/Content/style.css Site/Scripts/myjsfile.js Site/Images/filter...

Differences between methods of reloading pages

window.location.reload() history.go(0) window.location.href=window.location.href I noticed a website commenting that all 3 of these methods could be used to reload a page. Not content to trust it, I tried all 3 methods in IE8, FF3, and Opera 10. I noticed firefox performed a cache reload instead of a true reload for history.go(0), bu...

How can i focus on a given table's row with javascript\jquery?

Imagine a big html table with many rows that does not fit the screen, do you know how to focus on a given row with javascript\jquery avoiding the need to scroll down? many thanks Michele ...

Telerik Rad Textboxes and javascript issue

I am simply trying to fill a Rad Text box with server data in javascript. The data is placed inside of the textbox but it is not visible until i click on the Rad Textbox. function pickItem(name, sku, plu, nameBox, sBox, pBox) { sBox.value = sku; pBox.value = plu; nameBox.value = name; ...

jQuery.ajax() sends POST requests as GET in a Chrome extension

I'm building a small Chrome extension that must send messages through a POST http request to a server in my company network, and I'm using jQuery 1.4.1 to speed up the development of the javascript part. I have this code to send the request: function send() { $.ajax({ url: "http://mycompany.com/update", method: "P...

Is it possible to get a browser window to update while it is in a Javascript loop?

I have an Ajax call that currently needs to be synchronous. However, while this Ajax call is executing, the browser interface freezes, until the call returns. In cases of timeout, this can freeze the browser for a significant period of time. Is there any way to get the browser (any browser) to refresh the user interface, but not execute...

How do I find the ProgId for an ActiveX control using javascript?

I am using an ActiveX control and I need to find it's ProgId so that I can see if ActiveX is disabled using the " var p = new ActiveXObject(ProgId); " try/catch method. All I know about the object is what I put in my .aspx page: Also, I have looked up and down my registry and can't find that CLSID, maybe because it's only instal...

I would like to interactively detect when an ActiveX component has been installed, and asynchronously refresh a portion of the page

Hello, I am working on a website, and I would like to refresh a portion of the page after an ActiveX component has been installed. I have a general idea of how to do this with polling, which I am working on getting going : function detectComponentThenSleep(){ try{ // Call what I want ActiveX for, if the method is available,...

Have JavaScript answer calculate into a textbox, not a pop-up!

I have this code in the HEAD: <script LANGUAGE="JavaScript"> <!-- function calculate(form) { height = eval(form.height.value) width = eval(form.width.value) photos = eval(form.photos.value) lgtext = eval(form.lgtext.value) mountlam = eval(form.moun...

Catching in page links with jQuery

Hi i want to trig a function when user click in page links for example abc.com/hello.html#variable1 i want to catch #varible1 and execute a function. ...

jQuery.ajax gives "TypeError: Cannot read property 'documentElement' of null" on server but not local.

I'm having a problem with my jQuery code on http://alpha.spherecat1.com/, but the local copy works fine. As you can see if you visit the site now, the ajax call gives the following error: "TypeError: Cannot read property 'documentElement' of null" I've checked and rechecked and reuploaded everything I can think of. The documentation sa...

asp.net mvc: difference between dropdown & textbox onchange event

Having some pain with this event, I have some code like this for a dropdown: return helper.DropDownList(data.ModelEntityId.ToString(), selectList, "<Select>", new { onChange = onChange }); where onChange is a variable containing a javascript function to run, this works great. However with the textbox version (below) the onchange even...

MooTools classes

All my MooTools classes look like this: myClass = new Class({ initialize: function(options) { if (optionsType === 'object') { for (var key in options) { this[key] = options[key]; } } } }); Is this necessary? Doesn't MooTools have something built in for me that will p...

Looping, counting, and the setInterval method.

1) Would this construct technique work? Or would it need to have this.start()? 2)Would the index reset at any point? var imageRotate = new tRotate(); window.tRotate = function(){ __construct(); this.images = new Array(); this.index = 0; this.__construct = function(){ tRotate.start(); // Do other things } this.start = function(...

Using variables in a jQuery function

This line $(''+fullId+'') is giving me problems. I've created an array in a different function that gets the #id's of all the inputs in the DOM. Now with this function i'm trying to create a blur and focus jQuery function. I've set the variable fullId to prepend the '"#' and append the '"' to the variable name, but how do I get it ...