javascript

How intercept these two key: ":" and "." ?

I need to do something when a user push "." and something else when an user push ":" Is there a way to intercept these 2 key with javascript, jQuery or other ? ...

how node.js server is better than thread based server

Node.js server is works on event based models where callback functions are supported. But I am not able to understand how is it better than traditional thread based servers where threads wait for system IO. In case of thread based model, when a thread needs to wait for IO, it gets preempted so doesn't consume CPU cycles hence doesn't con...

Hide a row in a table and display it again?

I use a foreach loop inside ASP.NET MVC View page. For each element of the collection that foreach operates on I create two rows - one for display, one for edit. I want to hide the edit row and only display it later depending on user action. If I hide the edit rows with display: none, then jQuery's show() method cannot redisplay it agai...

How could I automate this fadeIn to become a slideshow?

Hi, I have the following code that automates a slideshow between the different slides as shown in the picture. This is now producing a fadeIn whenever I click on the numbers shown on the pic, but I'd like to automate the transition betweeh 1 to 5 and when on 5 return to 1 again on a timed maner. The screenshot is: <script type="te...

How would you keep a Math.random() in javascript from picking the same numbers multiple times?

I have an array var words = []//lots of different words in it. I have a Math.floor(Math.random()*words.length) that chooses a random word from the array. This is run in a loop that runs for a random number of times (between 2 and 200 times). I would like to make sure that the random numbers do not get chosen more than once during the tim...

How to get text from Address Bar in Firefox extension

Hi Experts I am building a Firefox Extension. I am using XUL and Javascript to do this. I need to get the text from my Firefox browser's address bar. Please don't get confused with URL where the browser has navigated, its just the text that user enters before the page redirects. Suppose user is at http://www.myexample.com or whatever p...

Where to submit own html, css, javascript tutorials?

I am planing to start writing tutorials on html, css and javascript. This year has been full of extremely interesting experience in this areas, so I wish to start on. Therefore, I wish to know the best places to submit my tutorials before publishing them elsewhere. I found just one very nice place: http://net.tutsplus.com/about/write-a-...

How To Include CSS and jQuery in my wordpress plugin ?

How To Include CSS and jQuery in my wordpress plugin ? ...

Custom javascript validation

Hi guys, Is there any way to show custom input validation message through javascript? I have javascript validation method innvoked with Form.Submit, so if validation goes wrong, I'd like to have a custom text next to the field I have validated (similar as ASP.NET MVC 2 validation summary). Regards ...

How to force a program to wait until an HTTP request is finished in JavaScript?

Hello, Is there a way in JavaScript to send an HTTP request to an HTTP server and wait until the server responds with a reply? I want my program to wait until the server replies and not to execute any other command that is after this request. If the HTTP server is down I want the HTTP request to be repeated after a timeout until the ser...

Jquery UI Datepicker on an image

Greetings, I want to pop up the Jquery Datepick as the image is clicked and displaying next to it. Once a date is clicked, I want to post my form. Here how I try this: The HTML: <form id="myform"> <span class="quickgo"> Quick Go: <select> <option value="1">Discovery Channel</option> <option value="2">History Channel</option> </select...

PHP multiple logins

Hi, I have one site having a login feature ,what i want is that if a user is logged in to his account from one computer ,and then again if he logs into his same account at the same time from another computer he should be logged out of the computer which he logged in in the first instance .Any idea how to implement it will be great . ...

Jquery call predefined functions?

All of the tutorials I see online are defining functions on the fly to respond to event handlers. I am trying to call a JS function when my form is submitted, but it never works quite right. In PHP: echo "$(document).ready(function() { $(\"#newDate\").submit( ValidateForm('".$ID."') ); });"; When the user hits enter for the input fi...

jquery ui autocomplete - not working in IE

This code works in firefox but not IE. Any ideas? I'm using the latest jQuery-ui libraries. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>jQuery UI Autocomplete Remote datasource demo</title> <link type="text/css" href="jquery.ui.all.css" rel="stylesheet" /> <script type="text/javascript" src="jquery-1.4.2.js"...

What is the correct way to save hidden data on a table?

I use the jTemplates plugin to load data on my tables. Because there are some properties I do not display yet I want available for later use, I save them in hidden fields and then grab them by their CSS's class name and jQuery's siblings method. Is this a correct way of doing such operation, or would this be considered terrible code? <...

error while traversing xml in javascript

i am using below code to traverse xml in javascript i am able to get value using x[i].childNodes[0].text; function in IE but not in firefox. please tell me what should i use so that it work with all. function loadXMLDoc(dname) { if (window.XMLHttpRequest) { xhttp = new XMLHttpRequest(); } else { xhttp = new...

Was just sent a JS virus. How do I safely display the output?

I just received a virus that looks something like this <script type='text/javascript'> <!-- var s="=nfub!iuuq.frvjw>#sfgsfti#!------REST OF PAYLOAD REMOVED-----?"; m=""; for (i=0; i<s.length; i++) { if(s.charCodeAt(i) == 28) { m+= '&'; } else if (s.charCodeAt(i) == 23) { m+= '!';} else { m+=String.fromCharCode(s...

Replacement for Google's GeoMap

Is there a decent non-flash replacement for Google's GeoMap? I'm trying to "push" redraws, but because it's flash it has to run back to Google, render a flash object, and then replace it. ...

jQuery, discover what a dom object's class are

I have a .click() on several buttons. Each .click() calls a function. The function needs to know which button called it so that it can show or hide different content and change the styles of the other buttons. The function has an event object passed to it. Is there a way I can get the current class that the event object has? ...

Are there any tools that can compare HTML documents by DOM structure?

I want compare two HTML documents, and want to know if they are the same. But only compare by DOM structure, which means ignoring the order of the attributes in a tag, for example, <table id="one" name="table">, <table name="table" id="one"> are the same. ...