javascript

Javascript function call not behaving the way I expect.

here is the html: <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr align="center" valign="middle"> <td width="10" class="pagestyle" onClick="pageNo(-1);" align="right">&laquo;</td> <td id="pageNum" class="pagestyle">1/5</td> <td width="10" class="pagestyle" onClick="pageNo(+1);" al...

Detecting Javascript Memory Leaks & Optimizing Code

Hello, Similar to xdebug+webgrind which gives us the rough time for execution for each function in a file etc, I am wondering how to go about optimizing as well as detecting slow javascript functions. Am sure firebug can probably do this, but am not sure how? Can someone guide me as to how to detect memory leaks also? How do I decide ...

Make alias to document.getElementById in Javascript

How can I alias the function "document.getElementById" I've seen it done using $ Thanks ...

How to reload Main Page from within an iFrame

Hi, Within my scenario, I have a button within an iframe section of my page that performs some database processing. What I basically need is a means of performing a page refresh of the main page, when this button within the iframe is pressed. Would appreciate the javascript that I can trigger within the iframe, that will reload the m...

How to check if an ajax function is busy from a previouse call

How to check if an ajax function is busy from a previous call? How can i prevent the call to an ajax function if it's readyState != 4 yet from a previous call? ...

Open html link in new window with no browser toolbars

I know that I can open html links in a new window by using target="_blank", but how can I hide/disable all the browser toolbars ? ...

Parent Div Click Function gets called when Child Div Click is clicked.

Parent Div Click Function gets called when Child Div Click is clicked. How to overcome this issue I am using ASP.Net with C# <div onclick="callme();"> <a href='#' onclick="Callme2();">Hi</a> </div> When I click on anchor tag the div elements onclick also gets executed. How to overcome this ? ...

Give Each Word In An <input> A Random Colour

How can I Give Each Word In An <input> A Random Colour ...

Setting window size with Javascript Form Action

Hi, I have a page where I am getting session values then calling form action through javaScript, please see the code below <%@ Page language="c#" AutoEventWireup="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> <title>SessionRedirect</title> <meta name="GENERATOR" Content="Microsoft Vi...

Copying one DOM XML node to another in javascript

Hey guys, I wrote a simple function to copy contents(including all child nodes) from one node to another of an XML DOM Object. Surprisingly in the function, the for loop is not iterating for n=1 for some reason i cant figure out, please help, i've been trying to debug this in all possible ways from 4 days. FUNCTION THATS NOT ITERATING...

Trigger Mouse Dragging in jQuery UI

Using jQuery 1.2.x and jQuery UI 1.5.x, one was able to trigger dragging manually like so: jQuery("#myDiv").mousedown(function(ev) { target = jQuery(ev.target); if (target.hasClass("drag-me")) { target.draggable({ helper: "clone", start: function() { console.log("drag start"); }, stop: function() { jQuery(this).dragga...

Form 'jumpy' in IE7

I have 3 forms on a site I am developing - http://79.125.12.14/contact/ They work fine on firefox et al, but they have this strange 'jumpy' effect in ie7. I'm a bit stumped. The forms are embedded Javascript Wufoo forms. Any ideas out there? ...

Simple JavaScript addition issues..

Hi all, I'm not so good with JS and for some reason when I try to add two fields together it joins them rather than adding the sum together.. this is the code I'm trying to use.. function calculateTotal() { var postageVal = document.getElementById('postage').value; //$68.50 var subtotalVal = document.getElementById(...

Slidesshow in javascript

I am doing a slidesshow image in javascript: function ImageLoop( images, speed, width, height ,inc){ this.img = images; this.speed = speed; this.width = width; this.height = height; this.interval = false; this.play = false; if (inc > this.img.length-1){ this.index = this.img.length-1; } else { this.index = in...

Save the anchor in the ie6 history

I have a site with anchor navigation (like gmail, when the anchor value changes a new content for a page is loaded with ajax). In Firefox, when I change the anchor (with js or with a page) a new item in the history is created and works perfectly. But in IE6 it doesn't stores this new item and the back button doesn't work as expected. Is...

Browser Caching in ASP.NET application

Any suggestions on how to do browser caching within a asp.net application. I've found some different methods online but wasn't sure what would be the best. Specifically, I would like to cache my CSS and JS files. They do change, however, it is usually once a month at the most. ...

ExtJS - using a custom TriggerField as a GridEditor

So I posted this last week to the ExtJS forums, but no one has responded and I'm going a bit crazy trying to figure it out: I'm fairly new to ExtJS (just learned it last week for work), but I've been working with other JavaScript libraries for quite some time now. I'm making a custom control for editing a list of attributes (currently p...

Javascript .pathname IE quirk?

Consider the following Javascript: var anchors = document.getElementsByTagName('a'); for(var i=0; i < anchors.length; i++) { alert(a.pathname); } When I run this on a page that contains links in the format "http://foo.com/bar", in IE8 I get back a string that looks like "bar". In Safari, Chrome, Firefox, I get back something like...

Excluding copyright/license headers in minified Javascript

Could anyone give me some insight into the implications of removing the GPL headers from Javascript frameworks and their plugins when used in a commercial website? We are using a minifier and combiner tool to produce one script. The only problem is the GPL license on the combined files will be larger than the source! Are there legal r...

How do I put adsense ads on my search results page?

I want to show adsense ads on my search results page. With Google Custom Search this is easy. However, I have my own search engine for my site, and I want to show adsense ads on the results page. It doesn't look like this is directly possible. My thought is to show my own search results, and at the same time call Google's search wit...