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?
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 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
What neat ways do you use for declaring JavaScript namespaces. I've come across this one:
if (Foo == null || typeof(Foo) != "object") { var Foo = new Object();}
Is there a more elegant or succinct way of doing this?
Just a bit of fun...
Hi,
I have a Iframe, and how to pass a javascript vairable to along with a iframe src.
ex:
var param1=test1;
how to pass "param1" value along with the iframe url.
and i want to pass like this.
<iframe frameborder=0 src="http://cart.demo.com/c_jp.php?action=param1" name="navigationframe" id="navigationframe" width="220" height="800">
Thanks in advance.
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 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 ?
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
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
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?
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.
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?
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!
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 :)
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)
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.
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
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....
Hello!
In my javascript i want to open URL in new window with this method:
var win = window.open(url...);
How can i check this, not to open the same window and lose all inputted data.
For example, if i opened "www.musite.com/addproduct" URL in new window, input data, leave my work place. then i click open window again, new window open and i lost all my data.
How can i achieve http://jdstiles.com/java/angledtext2.html this kind of angle(slant) using html , css and javascript. In design we have tabular structrer and by clicking on a tab the area beneath should refresh without reloading page (some thing like jquery or ajax).
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);
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?!
I'm doing some research for a JavaScript project where the performance of drawing simple primitives (i.e. lines) is by far the top priority.
The answers to this question provide a great list of JS graphics libraries. While I realize that the choice of browser has a greater impact than the library, I'd like to know whether there are any differences between them, before choosing one.
Has anyone done a performance comparison between any of these?