javascript

Some regular expression help?

Hey there. I'm trying to create a Regex javascript split, but I'm totally stuck. Here's my input: 9:30 pm The user did action A. 10:30 pm Welcome, user John Doe. ***This is a comment 11:30 am This is some more input. I want the output array after the split() to be (I've removed the \n for readability): ["9:30 pm The user did actio...

conditional or js to detect whether user is on windows XP?

Because windows xp renders certain fonts so poorly, i would like to detect whether the user is using that OS and add a class to the body accordingly. I'm looking ideally for an html conditional statement or php $_SERVER var to do this However failing that a piece of javscript along the lines of below would do if(users_os === 'xp'){ ...

GMap in iframe gets off-center

I have a Google Map (API 2) that used to work fine as a standalone page. However, when I load the map page within an iframe (with Thickbox), the map gets off-center: normally it's centered over Germany and in the iframe it centers on Iran, instead. How to make the map center correctly? My guesses: The problem can result from the if...

jQuery ready function

Can anyone tell me why the document ready function needs a call to function first please? I've been told that the setTimeout in the first below example (which does not work) would be evaluated and passed to ready, but I don't see what the difference would be for the function call in the second example (which works)? $(document).ready( ...

Javascript, Hour comparisson

Having two strings (start and end time) in such form "16:30", "02:13" I want to compare them and check if the gap is greater than 5 mins. How can this be achieved in Javascript in an easy way? ...

Getting Javasctipt Object key list

I have a Javascript Object like var obj = { key1: 'value1', key2: 'value2', key3: 'value3', key4: 'value4' } How can I get the length and list of keys in this object? ...

How can I prevent application domain stealing?

I'm in the process of making a javascript application and I want to bring that online, lets call it mydesign. I'm living in the Netherlands so mydesign.nl can be mine. Now is mydesign.com available for sale by some domain broker sales bastards. And those bastards don't accept a first bid lower than 1000$ which is a about ten times of the...

How to store search result ?

Hello, I am working on my personal site, where I want to store my customers recent search result limited to that particular session. I am using PHP platform and Javascripts. Here is an example of what I am exactly looking at : It stores your previously searched domain name for that particular session so that user can make decision ...

javascript date validation

Assume in my text box user enter like 18-06-2010 , Validation RULE if date is greater then current date then program should through the validation error like , PELASE ENTER PAST OR CURRENT DATE, DONT CHOOSE FUTURE DATE , Thanks ...

jQuery $.ajax response empty, but only in Chrome

I've exhausted every avenue of research to solve this one so hopefully someone else will think of something I just didn't. Relatively straight forward setup, I have a html page with some javascript that makes an ajax request to a URL (in the same domain) the java web app in the background does its stuff and returns a partial html page (...

Does anyone actually use the phrase DHTML anymore?

I'm not sure if this is exactly appropriate but I have what I think is a interesting question. Does anyone actually use the phrase DHTML anymore in a professional environment? I came across the the word the other day for the first time in years and shuddered at the thought of it. To me the acronym Dynamic HTML just sounds so 1999, it b...

location.hash in an iframe scrolls the parent window

Hi all. I have a page with an iframe. Inside the iframe is code (that I can't change) that sets location.hash to the id of an element in the iframe window. This has the unwanted effect of scrolling my outermost browser window so that the top of the window touches the top of the iframe. This is quite annoying as I have a toolbar above...

Beginners question: Variable in Javascript

Hello everybody! I'm new to javascript and cant get this little thing to work. (all external scripts a of course loaded) I have this jQuery script: $('a.Link').click(function(){ autoComp('City'); }); function autoComp(strFormName) { var Company = 'Adobe Apple Microsoft'.split(" "); var City = 'London Paris Berlin'.split(...

Need validation check which prompt as soon as user leave the control

Hello, We are developing an application where we have a Form to fill by users. Here is the scenario for some fields: Name : Does not contain numbers like 123 but it can be alpha-numeric like mynangal123 but does not contain special characters DOB : Does contain specific formats like mm.dd.yyyy or dd/mm/yyy or yyyy/mm/dd etc. doesn't c...

Playing html5 audio in android browser

I have a javascript that plays audio in the browser, using the html5 <audio> tag. It works fine in the iPhone browser, but not in Android. (Testing using a htc desire with android 2.1.) Anyone know why? My code: function playHTML5(sound, soundcv){ // sound = url to m4a audio file // soundcv = div in w...

How to redirect if javascript is disabled in asp.net mvc masterpage

I have a masterpage on which i want to check if user have disabled its javascript then redirect to a simple error.aspx page ...

How to print the contents of a Lightbox

How can we print out the contents of a Lightbox like the one used here? http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm ...

how to call a javascript function in the top frame?

This seems really simple, but how do I call a javascript function that's defined in the top-level html, from a child frame? top html doc - 1st level frame - 2nd level frame my top html doc has a function called testFn(). In the 2nd level frame I have a button with onclick="top.testFn();" but this doesn't call the testFn(). In Fir...

modal pop up like google

How to make modal popup like gmail (when we try to upload exe the pop up that generates covers scrollbar of the page) ...

javascript: getting the id of the parent from a document

Dear Great Coders, I am having some trouble to get the id of the parent of a document which is "iframe1" here. As you can see the javascript should be residing in the "" section. Do mind giving me some ideas? Yes, I know. I can insert the javascript on the top, but believe me i cant for some purpose because I am intergrating many othe...