javascript

AJAX not passing POST vars in IE7/IE8

Please Note: answers along the lines of 'use jquery' or 'use (insert wellknown framework)' is not helpful. Frameworks such as jquery includes alot of extra code which is not nessary at all for what I am doing. 'But, you can include one from Google', yes that may be the case, but I prefer to keep to my own code. With that in mind, lets pr...

textbox auto expandable

how can i make textbox auto expandable through javascript ...

Cant append "used" DOMObject in IE

I have some objects, that keep created DOMObjects, like here: function category(){ var domBlock; this.block = function(){ if (!domBlock){ // Here dom-object constructor $('<div></div>'); etc } return domBlock; // jquery object, // but i test and native document.createElement ...

Got stuck in the asynchronous nature of Ajax requests

I declare a variable with the var word inside a function that handles Ajax requests, then later on in the function I have another function that should change the value of the variable but - my problem - it fails. How to settle the problem down? Here's similiar code I use: function sendRequest(someargums) { /* some code */ var...

decode gzip using jquery / javascript

hey guys i want to parse a restful xml web service which is gzipped using jquery or javascript . can anyone help on the same ...

Javascript help needed - which variable is return empty??

Hi I would like to know how do I add an error check to below mentioned code...I mean how do I check if this code return empty or not?? if this returns empty then I would give a message "Not Found".. How do I do That?? google.load('search', '1'); var blogSearch; function searchComplete() { // Check that we got results document.get...

How to replace certain text/string in selected area using javascript

I have written a text editor using JavaScript. Here I am not storing the written text in any variable, Now I want to replace some text/string of some selected text with other text/string. Can anyone suggest me, how to do it using JavaScript. Thanks ...

Highlight polygon and tint rest of map using Google Maps

Hi, I'd like to display a highlighted polygon using Google Maps. The idea is that the polygon in question would be displayed normally and the rest of the map should be darkened a little bit. Here's an example image what I would like to accomplish with a polygon from Austria: Unfortunately, I'm a complete rookie when it comes to Goo...

How to test Text Field Validate a comma exists in a field

How to test input Field Validate a comma exists in a input field ? ...

ajax/JS timed countdown?

Let me explain what I'm trying to do. I want to make a simple box which counts down numbers at intervals I specify. For example, I'd like to set it to start at 150, and then I want to set it to drop by 15 every 30 seconds. Is this possible with AJAX/Javascript? If so, could someone point me in the right direction? Would really apprec...

JS sort works in Firefox but not IE - can't work out why

I have a line in a javascript function that sort an array of objects based on the order of another array of strings. This is working in firefox but not in IE and i don't know why. Here's what my data looks like going into the sort call, in IE7. (I'm using an array of three items just to illustrate the point here). //cherry first then...

Need help with Xpath methods in javascript (selectSingleNode, selectNodes)

I want to optimize my javascript but I ran into a bit of trouble. I'm using XSLT transformation and the basic idea is to get a part of the XML and subquery it so the calls are faster and less expensive. This is a part of the XML: <suite> <table id="spis" runat="client"> <rows> <row id="spis_1"> ...

Drupal 6: defining js and css for particular pages.

Hi friends, I'm a drupal newbie... When I define css and js at filename.info file, it takes effects for all pages. I have some particular css-js files for some particular pages, and I don't wanna slow site down by importing all these files for the pages actually no need these files. How can I define js and css for particular pages? A...

Can't calculate width of elements

I try to get width of DOM objects: function resizeArea(){ var width = 0; area.children().each(function(i){ alert(this.offsetWidth); width += this.offsetWidth; }); area.css('width', width); } In get results: Chrome: 800 Opera: 708 FF: 783 IE: 714 But if see it in firebug, dragonfl...

Is this the right way to setup up an image within a link?

$('<a />').attr({ 'href': '#' }) .append( $('<img />').attr({ 'id' : 'img', 'src' : 'edit.png' })) .appendTo('body'); Is the the "right way" to go about adding <a href="#"><img src="edit.png" id="img" /></a> to the body? Also how would I add some css onto the img? ...

Scope of This JavaScript Variable

I have a question and an issue wrt the code below: My question is what is the scope of the variable loaded here. The reason why i ask this is the onload="if(loaded==1)inittextarea() code is working fine on Firefox and not IE8. Why is this happening? Is there something specific i need to do here? Or is it not a valid practice? <html> <h...

setting focus to specific item in a listbox using javascript

i want to set the focus but not the focus of the page to that element i mean when the user slides down then that specific item appears in focus ...

How to keep a floating div centered on window resize (jQuery/CSS)

Is there a way (without binding to the window.resize event) to force a floating DIV to re-center itself when the browser window is resized? To help explain, I imagine the pseudocode would look something like: div.left = 50% - (div.width / 2) div.top = 50% - (div.height / 2) UPDATE My query having been answered below, I wanted to pos...

call back function set by JS settimeout doesn't work in IE8....

<html> <head> <script> function addEvent( obj, type, fn ) { if ( obj.attachEvent ) { obj['e'+type+fn] = fn; obj[type+fn] = function(){obj['e'+type+fn]( window.event );} obj.attachEvent( 'on'+type, obj[type+fn] ); } else obj.addEventListener( type, fn, false ); } </script> </...

how to set focus on top of the page

top of the page focus ...