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?
Hi,
could someone recommend a PHP form validation library (that works independently outside of any php framework) that apart from doing all sort of basic validation (is empty, vs regex, is email, is alphanumeric and so on) can produce javascript code (ideally to work with jquery) to validate the very same form with the very same rules client-side and hence define validation rules in a single place and have a form validated both server and client side?
Thanks.
Hi,
Do you know any Javascript Tree Creator that lets you add or remove nodes up to 3 levels deep?
I'm currently using the jQuery treeview but is currently coding the add and remove of node items which is hard.
Cheers,
Mark
I'd to use DW cs 4 but before to buy I want to test javascript code hints.
However that feature doesn't work at all.
I have an external .js library and then into an html file I load it
but when I type functions or object by name nothing happen.
Any idea?
Is there a way to show the structure of a javascript class declared using Prototype's Class.create function in the Eclipse outline view?
The declarations look like:
var Foo = Class.create({
bar: function() {
...
},
baz: function() {
...
},
});
At the moment all I get is "Foo:".
(A google search turned up http://marketplace.eclipse.org/content/prototypewtp, but the link to the plugin homepage is dead)
Is it possible to simulate a click on a webpage using javascript but without defining a specific element, but rather just specifying the document?
I would have liked to do something like this, and if the location happens to have a link, then this will be pressed:
function simulateClick(x, y)
{
var evt = window.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window,
x, y, x, y, 1, false, false, false, false, 0, null);
window.dispatchEvent(evt);
}
Hi,
I have been looking for a Javascript algorithms that gives me the week number of a given Date object within a custom fiscal year. The fiscal year of my company starts on 1 September and ends on 31 August.
Say today happens to be September 1st and I pass in a newly instanced Date object to this function; I would expect it to return 1.
Hopefully someone will be able to help me with it.
thanks,
fbr
I'm pretty efficient in jQuery, having implementing it in several projects for my company. However, I found myself a little lost when reading stuff like node.js.
Do i have to go back to basics and learn the javascript language or should i just stick with jQuery?
Hi,
How do I detect change event on textarea using javascript?
I'm trying to detect how many characters left is available as you type.
I tried using the onchange event, but that seems to only kick in when focus is out.
Thanks,
Tee
I have a 24 hour time string (ie 16:30) and would like to add x time blocks of 30 mins. For example if x = 4, then 16:30 + 4(30) = 18:30. Is there any easy way to do this with out exploding the string and doing if statements for mins/hours.. etc? Also this is on a php page would it be easier to do this in php then echo it to the javascript?
Thanks for the help!
I d like to execute a remote javascript which redirects the user to another page on my domain with data that s passes as query string. I want to get this data which is passed on to the page on my domain.
$.getScript('http://site.com/foo.js', function() {
**//foo.js redirects to another page on my domain with data
// and i d like to capture that data from this function,
// at least if i find the parameters that passed on there, i ll be fine.**
});
What to do ?
in a code which i am goin through there is a link has href=javascript:; in code.when it is clicked it opens a lightbox to show some msg with close button.how is it done.I think this uses dojo
In Javascript I can write:
function TheFunc(arg) {
...
}
or
TheFunc = function(arg) {
...
}
or
TheFunc : function(arg) {
...
}
What's the real difference and when should I use which?
If I create a cookie in Javascript document.cookie = 'unseen' how do I delete it when I navigate away from this page? This is the only cookie I am creating on the page.
How can i create a cookie by using javascript just for end of the browser session(ie,upto closing of current browser).My script is like follows;
function setCookie(c_name,c_value,c_expiredays) {
var exdate=new Date();
exdate.setDate(exdate.getDate()+c_expiredays);
document.cookie=c_name+ "=" +escape(c_value)+
((c_expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
setCookie('gs_cookie','firstme',1600000);`
How much value i need to pass instead of 1600000. Please help....
I have a nodejs TCP server and a client. Basic network communication happens. Client sends "data + STX_CHARACTER + data + ETX_CHARACTER" (just an example).
How do I split the string using the STX Control Character as a delimiter or how do I reference the character at all in Javascript.
Hi
Does anyone know what's the replacement method for FB.CanvasClient.startTimerToSizeToContent() to resize iframe content in the new javascript SDK for Facebook?
Or maybe if there is an alternative technique for achieving the same effect?
Thanks
My layout breaks if I change the window size in IE7/AOL, so I added a simple javascript function that fires on window.onresize, but no matter how I change the location I get problems.
It was suggested I post a link and here it is:
link text
I already use PHP to detect browser and include an IE7-only inline stylesheet (and for mobile browsers), and my page looks nearly identical to the way it does in FF, Opera, Chrome, Safari and IE8, but when I change the window size, some things go wonky, and come back into line if you refresh. Any advice is welcome :)
How can I tell if a google bot is reading my javascript generated content?
I have an AJAX script that generates some text dynamically on a page... this content does not change by user, but simply by date/time.
I am not sure how I can tell if google sees it.
In the scenario below, how can I get references to the variables declared during eval()?
function test() {
eval("var myVariable = 5");
var locals = magic() // TODO What should we do here?
alert(locals["myVariable"]); // returns myVariable
}
Just a note: JavaScript being evaluated comes from a trusted source.
What is the JavaScript equivalent to the following PHP code:
$expTime = time() + (5 * 60 * 60); // now plus 5 hours (5 hour; 60 mins; 60 secs)
$expTimeStr = gmdate('Y-m-d\TH:i:s\Z', $expTime);
Hi
I need some code to zoom an image when i mouse over that image, i want to zoom that image.
Consider i have 10 images in y page, when i put mouse over in first image that image should zoom and when i mov to second second image should zoom like that...
how can i do this, need some javascript or jquery something like that.But not sure.how can i do this...
Please help me
I got the Wrox.Beginning.JavaScript.3rd.Edition and wanted to start learning it from scratch, then my boss came along and said that why bother, learn jQuery.
Can I understand jQuery and work with it although I am a newbie and have limited knowledge in ASP.net, vb.net, some C#, and basic HTML?!