javascript

Reverse IP Logfile Analysis API

I have a list of IP addresses, about 1300, that I need to look up to find out company information or whatever is available from an online tool. I don't mind if I have to pay for it. but I don't want to have to put each one in manually. Is there something that I can use that would give me this detail that I could either copy or paste or ...

Get difference between 2 date in javascript?

Hi How do I get the difference between 2 dates in full days(I don't want any fractions of a day) var date1 = new Date('7/11/2010'); var date2 = new Date('12/12/2010'); var diffDays = date2.getDate() - date1.getDate(); alert(diffDays) I tried the above but this did not work. ...

need direction regarding jquery and json

Hi, I have this url which is JSON webservice http://ws.geonames.org/weatherJSON?north=90&south=-9.9&east=-22.4&west=55.2 I need to write a jquery function to access the JSON object from the above url. I am not sure how to proceed with this task. Could someone help me out with starting out the jquery code? Thanks Inorde...

Google Maps v2 div inside or over map

I just need put one div (or more) inside or over map, something like a menu inside the map area, I need when i load my map this div is there... css can't do it right? that div contains php code... ...

Undesired page scroll when changing content of fixed element

So I've made a menu sort of thing, affixed to the bottom of the screen via CSS fixed position, and it works fine. Only problem is that when the page is scrolled down somewhat, and then the menu activated (slide up animated with jQuery), the page jumps to the top again. It's pretty irritating. Here's some pertinent code: //handle click o...

recaptcha refresh button in django

I am using recaptcha django form following this tutorial . It works fine only the little refresh button not working on the recaptcha image. Not sure what is going on. the generated code of recaptcha <script>var RecaptchaOptions = {theme : 'white'};</script><script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6Lc6YL...

How can I share code between Node.js and the browser?

I am creating a small application with a JavaScript client (run in the browser) and a Node.js server, communicating using WebSocket. I would like to share code between the client and the server. I have only just started with Node.js and my knowledge of modern JavaScript is a little rusty, to say the least. So I am still getting my head ...

'if' statements don't function correctly

I am writing some jQuery code that involves jumping from several functions. In one function, an 'if'-statement is used to select where the code will go next. The condition for the if statement is the value of a variable that was passed from the previous function. So, to clarify, a function passes a variable to another function, which the...

Firefox 3.6 crashes when trying to display a thumbnail

I use Uploadify to upload multiple pictures to server. I want to display pictures thumbnails before the pictures are actually uploaded to the server, based on this. I use Firefox 3.6.6. Here is how I thought to do this: $('#fileInput').uploadify({ ... onSelect: function(event, queueID, fileObj) { var img = document.cre...

Javascript to turn an unordered list into multiple columns.

There doesn't seem to be an easy way in (well supported) css to do this. I'm looking for a javascript solution, preferably jQuery. I have an unordered list like this: <ul> <li>A</li> <li>B</li> <li>C</li> <li>D</li> <li>E</li> ...etc </ul> I want each column to have a height for example four items and ...

How to make javascript Date.parse understand short years?

Hi I noticed Date.Parse can't handle only 2 digits dates. Say I have this mm/dd/yy = 7/11/20 Date parse will this it is = 7/11/1920. Can you set it to use the year two thousand? Like it's kinda weird I got the jquery u.i date picker and if you type in 7/11/20 it will figure out 2020. So it would be nice if date.parse could keep up ...

JavaScript/Jquery RegEx to validate an EMAIL Address isn't working correctly.

I'm using the following lines of JavaScript to validate an input as a valid email address: // Check for a valid email address var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var address = $('#formRegister-emailAddress').val(); if(reg.test(address) == false) { // Validation Failed alert('Please enter a va...

Need help with inArray

Hi I have the following function, I need to make it return false only if one of two other checkboxes are checked. $.validator.addMethod( "ReutersNA", function(value, element) { var selectedCountry = $("#Country").val(); var NorthAmerica = new Array("USA","CAN","MEX"); if($.inArray(selectedCountry,NorthAmerica) > -1) { r...

Strange behavior when loading page using XMLHttpRequest

I have a script like this: var xml_http_request = new XMLHttpRequest(); xml_http_request.addEventListener('readystatechange', PageReady, false); xml_http_request.overrideMimeType("text/xml"); xml_http_request.open('GET', "index.xml", true); xml_http_request.send(null); function PageReady() { if(this.readyState != 4) return;...

detect if iPhone/iPad is password protected

I am fairly sure that this would not be possible, but just want to check. Is it possible to work out if a user has their iPhone/iPad password protection turned on. We are working on an application that contains very sensitive corporate information, we would like to avoid having to ask the user their password every time they open the iP...

How to implement a chatroom?

I am very wondering if there are any popular apis/frameworks currently available to do this? I am familiar with PHP and Javascript. So I am wondering how would one design a chat room? How does the server push the data to the individual connected clients? I would like to build the server and the client side all on my own as a practice....

How to set session max inactive time?

Hi, I get the session MaxInactiveInterval time using the following query. I am developing web application using JSF Framework var sessionMaxInactiveTime = ${pageContext.session.maxInactiveInterval}; I need to set maxInactiveInterval. how to set maxInactiveInterval using JavaScript, JQuery, or to write Servlet. But i want to contr...

Dealing with conflicting javascript libraries in a Rails 3 app

Id like to understand the best approach when using multiple (and conflicting) javascript libraries in a rails 3 app. Before the js conflict was raised, I used the application.html.erb template to define all javascript libraries template on all pages with: <%= javascript_include_tag :all %> I intended to cache all the js files into one...

How to hide html elements depending on what title they have with jQuery?

Hi, I need to hide some elements depending on their title value (it's a SharePoint site and sharePoint adds a guid to all element names and ID's), I saw that with jQuery it is possible to do this quite easily but I don't get it to work. I saw http://stackoverflow.com/questions/3080339/get-element-by-title-jquery/3080346#3080346 but it ...

how to enumerate all the div tag with same id?

I have web-pages based on widget and I have given all the div the same ID attribute. After the page is loaded, I want to enumerate all the div element which matches the ID element 'widget'. I am using jQuery. Then I want to get the internal div attribute within the 'widget' div which shall be used as a tooltip. <div id="widget" class=...