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 All.
I can't find great way to debug javascript. I know firebug on firefox, but it's not best way I think. I want to put break point and trace program but I can't with it.
Do you know good tool or how to trace the program.
Ok so I'm trying to access the first element of a JSP list,
here's what I've come up with so far without any kind of luck:
onclick="alert('<%=list[0]%>');"
What's the best approach to access the first element and eventually to pass it to a javascript variable/function ?
I've heard that the <% %> tags are deprecated and some are suggesting relaying on JSTL/EL how can one use those without having to iterate the entire list and put a breakpoint for the iterators ?
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.
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?
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
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 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
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....
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 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.
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!
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,
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
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);
}
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 ?
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 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?!
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?
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,
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.