javascript

jQuery reversing animation on second click

I have a div element that on the click of a link slide in from the right and slides to the left, the works great, I am now trying to get so that if the link is clicked again it runs the animation in reverse, I have tried add a class to the link when the animation runs and then doing the same animation but backwards, but that does not wor...

Web based chat in asp.net , using ajax timers , will it perform for large number of users

Hi as all we know that we can create very simple chat using ajax timer & web service , it runs well for few users . i want to leaverage same idea for site where 5000+ users will be there in chat room , messages are stored in queue hold in memory * dispatched as user request that is through java script timers calling page method or ser...

How to make custom, no editing need, bulletproof jquery's noconflict version?

in my job i always have to use jquery with prototype can i make any custom jquery with library file like once i will add in head and then no need to change anything in any code. is it possible? I don't want to change anything in an code $ to jQuery. ...

disable text highlighting on double click in jQuery

I have this jQuery toggle. It work fine. <ul> <li>Go to the store</li> <li>Pick up dinner</li> <li>Debug crash</li> <li>Take a jog</li> </ul>   $("li").toggle( function () { $(this).css({"list-style-type":"disc", "color":"blue"}); }, function () { $(th...

validate tricky fields

in my form fields i've got watermark text that disappears when the user is typing something in them. but then, i cannot use jquery validation plugin http://docs.jquery.com/Plugins/Validation#Example for checking that the user has typed something in the fields cause in either way, they will contain text. so how can i validate that the u...

Need to call servlet from javascript along with parameters

I have session key that is a javascript variable which i get from a Rest api call. I need to call a servlet and pass that key as a parameter. What Javascript function can I use to do that? ...

How to hide the URL address which shows on the bottom of the papers when printing something from a website?

Is there away to make a web page print without showing the URL at the bottom of the printed pages? Or if possible to hide the page numbers which shows at the top? ...

self destruct button in html

Is it possible to destroy an html button. If it is clicked because it already served its purpose after clicking. ...

Tool to merge 3 CSS files

Merging huge CSS files is huge pain, Hi i found some question asked on the same line. I tried some of the tools but they end up merging line by line rather than on the basis or CSS rules. Now i thought i should right one good program to do following, 1. read CSS file convert in XML 2. sort it on the basis of CSS rule Now write one mor...

Pop up box with a timer

hi, After some specified inactivity time (IDLE Time say for 10 mins) the application should give a pop up box with a timer (should display like 60 59 58 ....1), that box should close within 60 secs with cancel option selected and that browser should close if user didint select any option .If the user selects cancel options within 60 se...

Client side screenshot generation with javascript

Hi, i'm building an application that requires the generation of a screenshot of a page via javascript. I've found this question: http://stackoverflow.com/questions/683718/generating-browser-side-web-page-thumbnails The question is quite old, so i want to ask you: with the new releases of chrome and safari, do you know if webkit has im...

How can I write a real time stats system? in ajax and php

I trying to make a realtime stats bar. And I think of using the Long Polling concept. But when a request is send to php. I need a way of testing if the stats are updated. Now I can just make a loop with a database query, and test it. But that just doesn't seem right to me :) Is there a more inexpensive method of testing the database f...

How to ask confirmation when closing a window ?

Hello everyone, I want to pop up a message asking for confirmation if the user wants to leave the current page, exactly like stackoverflow does it when you are typing a question. Could someone help me on this, by giving me a script or redirecting me to an answer (on this site or elsewhere) ? Thanks ...

Javascript: access to an object's member by name

I have an object called "themesData". var themesData = {} themesData.a = { key: "value" }; themesData.b = { key: "another value"}; and I want to access one of the members by its name - I get a string which contains either "a" or "b" and I want to get the appropriate member's value. I'd be happy to get some help on that. Thanks! ...

When would JavaScript == make more sense than ===?

As 359494 indicates they are basically identical except '===' also ensures type equality and hence '==' might perform type conversion. In Douglas Crockford's JavaScript: The Good Parts, it is advised to always avoid '=='. However, I'm wondering what the original thought of designing two set of equality operators was. Have you seen any s...

Is there a JS diff library against htmlstring just like google-diff-match-patch on plain text?

Currently I am using google-diff-match-patch to implement a real-time editing tool, which can synchronize texts between multiple users. Everything works great when operations are only plain texts, each user's operation(add/delete texts) could be diff-ed out by comparing to old text snapshot with the helper of google-diff. But when rich f...

VB.net Google Map retrieve data info from databse

I am using google map API to show the map and some marker, when user click on the marker will show the location info. Those info i store inside databse. How can retrieve the data when the marker is been clicked? Because the google map code is in java script how to link with vb behind code? ...

Internet Explorer line 1 char 1 code 0 error

I'm using jQuery+drupal and some jQuery plugins. All is ok with Firefox. But in IE's i'm receiving problem like this. Line: 1 Char: 1 Error: object expected URL: http://businessway.am I have included .js files. How to know where is the problem? In which file? Line 1? Which file? If you can please check site which I gave before. ...

Drupal Help - Warning: Unresponsive Script - Everytime Goes into or out of Block Edit Mode

Every time goes in and out admin-build-block page, the annoying "Warning: Unresponsive Script" pop-up shows up along with such details: A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: http://domain name/sites/default/files...

JS: Click h1 to set display to none at another div

Hello, I'm very new in scripting with js. My question is, how can i set an onclick at an h1, which set the display to none at another div? Here my code: var iter; function toggleGroups() { function getAllGroups() { titlebars = document.getElementsByClassName('titlebar_js'); ...