javascript

Hiding / Showing a Table with JavaScript

hi i have atable with some data and i have expand and Collapse button there if we click on + it will expand and show table and if we click on-it will collapse and i am using following code but i am getting error with document.getElementById('eleName'); imageXchk='expand'; loadedCheck='false'; function toggleDisplayCheck(e, tableSize...

non-AJAX jquery POST request

i am trying to use the jquery POST function but it is handling the request in AJAX style. i mean its not actually going to the page I am telling it to go. $("#see_comments").click(function() { $.post( "comments.php", {aid: imgnum}, function(data){ }); }); this func...

Converting Some Code to jQuery

Hey guys, I have some code that I found that I would rather use as jQuery instead of direct JavaScript. Hopefully you guys can help me convert it: var sub = document.getElementById('submit'); sub.parentNode.removeChild(sub); document.getElementById('btn-area').appendChild(sub); document.getElementById('submit').tabIndex = 6; if ( typeof...

How to implement such an associative array?

arr[key] = value; where key is a jQuery object and value is an array. ...

JSON and whitespaces in identifiers

Question: The JavaScript code below: records is JSON serialized data. I can access it right away from JavaScript by using for example alert(records.data[0].Phone); The problem now is that some bright spark used a whitespace in FirstName and LastName, which means I would have to access it like alert(records.data[0].Last Name); Which...

Where toString fails to work?

function dTree() { return { init : function(data) { this.data = data; }, node : function(i){ return '' + i; } } }; dTree.prototype.toString = function() { var str = ''; for(var i = 0; i < this.data.length; i++) { str += this.node(this.data[i]); }; ...

Can this be called recursive?

function move() { pos = pos+1; t = setTimeout(move, 100); } Can that be called recursive? If yes, could you provide any reference? Thanks in advance ...

php chat client

i need to create a chat application in php+js+ajax which need to be integrated to a site, where am stuck is to create a chat window , that need to be constant while going through different pages in the site . if any one can suggest a better way i will be grateful, thanks in advance ...

Best Open Source Spider for Site Coverage.

I am interested in crawling a lot of websites. The most important consideration is that the spider is able to reach as much as the site as possible. One key feature that is lacking from most spiders is the ability to execute JavaScript. This is required in order to crawl ajax powered sites. I really like Open Source and I will need t...

Why isn't "right click" more used in web applications ?

More and more applications are moving to the cloud: Google Docs for productivity apps, Meebo for instant messaging, Gmail for e-mails, Salesforce for CRM, etc. Yet, I've noticed that, unlike their desktop counterparts, very few of those web apps leverage the mouse's "right click". Most of the time, when right clicking in a web app, I g...

creating a webpage for iphone

i am creating a web page for iphone, i need the page to display efficiently in the iphone as well as on pc's. I'm coding in xhtml and uses support of JavaScript and css. The problem is that, i'm getting the correct view in the pc's but too small in the phone.how to adjust the size of the page. I am checking the user agent and loading a s...

JSON and XMLHttpRequest ?

Question: I'm trying to use JSON, but all i find is JSON parsers, which I don't need... I've read that with JSON, you can do cross-domain requests. but all I see is implementations that use XMLHttpRequest... - which means you can't use cross-domain requests, at least not outside IE... I've been on http://www.json.org/, but all I find ...

How to get the value of a field during the paste event?

I have a text field that I'm binding the paste event to using JQuery. When I first paste something into the form field and log its val() it returns a blank string. Likewise, if I paste again into the field, it returns the previous value before pasting. Essentially I have a race condition or sequencing issue, for lack of a better term....

iphoto-like thumbnail view with jquery

Hi, I'd like to create an iphoto-like album thumbnail viewer, just with words, not photos. For example, when you mouseover over a div box, the div box text changes as you incrementally move right with your mouse. Does anyone have an idea about how to begin developing something like this? ...

Chess game in javascript

Is there any Chess game API , purely written in javascipt ? No Flash! Anybody know the algorithm(in general) used in Chess games ? ...

Multiple select box with otpgroup

Hi, How to modify the script to work with optgroup? I would be very thankful to you in this regard. Thanks. ...

JQuery - IE6 - How to FadeOut and FadeIn simultaneously ?

I have a sequence of position absolute div, say <div>...</div> <div style="display:none">...</div> <div style="display:none">...</div> <div style="display:none">...</div> I wrote a simple slide code using jQuery currentDiv.fadeOut('slow'); nextDiv.fadeIn('slow'); It works perfectly in FF/Chrome/Safari/IE7/IE8, but not in IE6. I fou...

can you say this is a right example of Javascript Closure.. Where the places we need to consider avoiding the closures??

Hi, Problem & Reason One of my team mate ended up in messy situtaion implementing function hooking in javascript. this is the actual code function ActualMethod(){ this.doSomething = function() { this.testMethod(); }; this.testMethod = function(){ alert("testMethod"); }; ...

Creating a webpage for mobile browsers

I'm creating a website for mobile users as well as for pc users. I want this website to be viewed properly on both these end users. I'm now basically looking into the part of mobile users. When i load the page on my mobile, it seems to be a way too bit smaller. I need to reduce the whole body size of the page or its resolution to fit the...

Ajax XML issues with XSS validation

While using Ajax in web applications we use XML to transfer the data between server and client. However XSS validation comes into picture, So questions are, 1. Is passing XML like this is correct? 2. Are we exposed to security issues if we turn off XSS validation? 3. Can passing Ajax request with header (content-type = application/xml) ...