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?
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....
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 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
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'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?
Hi there
Just out of curiosity I was wondering how is it possible for the javascript code to embed google maps communicate with server from outside domain. I know I'm missing out something here. can anyone help?
thanks
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'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 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 have an asp.net button, that when clicked calls a code behind function. The function does some evaluation, and then I want to call javascript from within this asp.net function.
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
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.
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)
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 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?
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);
}
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 :)
Hi,
Just wondering if it's possible to pass a global javascript array value into a html tag, specifically inside a img (title) tag?
Basically want to know if I can do this:
<img src="_info.gif" height="26" width="37" title=myArray[5]/>
If so, how and if not, can people possibly provide other suggestions.
Thanks
Hi,
I'm trying to get the innerHTML value of a node. The value is D&O. When I try to get this value using innerHTML I'm getting D&O. Is there any option to get the exact value rather than encoded value using Javascript? Please help me.
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.
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 have a javascipt code something like
<script type="text/javascript" src="http://ads..........." ></script>
this script shows a banner. i want to use onClick event with this script without disturbing the banner click. is that possible?
I am searching for an expression builder GUI (like the one used in Microsoft Access). It can be plain Javascript or JQuery plugin. I am loathe to build my own and reinvent the wheel if one already exists - and yet, a search on Google does not find anything remotely useful.
Is anyone aware of any such library/plugin or article that covers this?