Weird Date Stuff...
Jul 23, 2005
Hey JavaScript gurus!
Here's a weird one:
If I check (with an alert) this line:
vStrDate2 = vDate.toLocaleString();
I get: Saturday, August 14, 2004 7:57:30 PM (as I should)
but this operation...
vStrDate = vDate.getMonth() + "/" + vDate.getDate() + "/" + vDate.getYear();
Avails me: 7/14/2004 (!?!?!?!)
I check my computer date and it definitely believes (as do I) that it is
August. Any idea why getmonth() thinks it's July?
Also, is there an easier way to get this American date string?
View 5 Replies
ADVERTISEMENT
Sep 19, 2006
I have the following script:
function Test(){}
Test.F = function(){}
Test.F.FF = function(){}
Test.F.FF.FFF = function(){}
Test.F.FF.FFF.FFFF = function(){}
//var alias = function(){};
var alias = Test.F.FF.FFF.FFFF;
var date1 = new Date();
for (var index = 0; index < 100000; index++)
Test.F.FF.FFF.FFFF();
//alias();
var date2 = new Date();
print(date2.getTime() - date1.getTime());
Why is it when I use Test.F.FF.FFF.FFFF() I get around 100ms and when I
get alias() I get around 280ms?
What is going on here? This is something I would have never anticipated
and I think that neither of you as well. Aliases whould work faster
then doing lockups at each iteration, right?
Also if I uncomment this line: var alias = function(){}, from 280ms I
get a drop to 265 ms?
View 22 Replies
View Related
May 7, 2011
i'm looking for some help with a weird problem I've come across. So, I'm using jQuery's toggle() function to hide and show a html element, for example a <div>. Then I put the current state in a cookie ( visible / not ) and when I refresh the page I get the data from the cookie and if the state says non-visible I hide the element. So far so good. However, I wanted to add some animation to the whole thing so I've put slideToggle() instead of toggle() and it works, but when I refresh the page, the element won't hide. Any idea what's the problem? Am I wrong going for slideToggle?
View 1 Replies
View Related
Jan 7, 2007
It works OK in IE and Moz, but in Opera the change of the attribute's value works on once, first time. No error. That confuses me. Why works only once? Any ideas? Code:
View 16 Replies
View Related
Feb 5, 2010
For some reason, when i split a basic string in IE I'm getting an extra value in the array which is something like this:
function(v,n){n = (n==null)?0:n; var m = this.length;for(var i = n;
That's the actual value. Here's the call I use:
var value = "test@test.com, test1@test1.com";
[code]....
View 2 Replies
View Related
Jan 15, 2011
ok, here's the background on my "lets learn jquery" debacle ... I have downloaded it (plus the UI) and that demo index.html loads and functions perfectly.
well, I can create a brand new .html document, and include just the jquery.js and perform something, and it will work ... here's the thing, if I change *anything* in the source file, the content in firefox will not refresh ... I could even delete random tags, including the <body> tags, the <h1> tags and text ... and it will just not carry over to the browser. And, if I view the source on firefox it will show a random amount of lines removed from the bottom of the .html file
what in the world is happening ... it is driving me crazy that i cant figure this out. (btw i'm using jquery1.4.4 on centos5.4 + apache2.3.3, and firefox3.6.6 from win7 if it matters)
to recap, if i start with a blank/fresh/from scratch file it will work as designed ... but as soon as I change anything, adding or removing code/content, it blows up randomly displaying content (even old content that isnt even saved in the .html file anymore!)
View 1 Replies
View Related
Dec 2, 2011
Warning: Complete newbie! I am trying to installthis simple slideshow as a header on my site. It is working fine, but there is an incredibly large gap after the header (see photo below) that is not supposed to be there. Here is the code I am using:
<script language="javascript" type="text/javascript" src="http://www.logfinish.com/logfindesign/pop-up.js"></script> <table width="1004" border="0" align="center" cellpadding="0" cellspacing="0">
tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<style>
[Code]...
View 1 Replies
View Related
Mar 29, 2007
Is it possible to have a pop up window without the Microsoft stuff at the
top?
View 5 Replies
View Related
Oct 31, 2011
im really new to Ajax and JavaScript, but I did a lot in ActionScript 3 and C#.
[Code]...
View 6 Replies
View Related
Feb 6, 2011
... like if you input text, you can't select it by sweeping it with the mouse, or shift-left arrow. Which I thought were out of the box features.You can see it in the bottom right corner of the map here I don't think the autocomplete has anything to do with it (I disconnected that and nothing changed) but maybe because it gets made by innerhtml?
View 12 Replies
View Related
May 25, 2010
I just came back from a trip to find that my teacher has given us a new task,and it has javascript in it, witch is something I have barely been working with since we have not been given any tasks with it before.And the worst part is that I only have 2-3 days to do it.The task is a site that must has a javascript image gallery with thumbnails and when you click the thumbnail the image in it must fill the frame of the images in the gallery.. (Don't know if any one gets that )Adding a picture to this post. http://bildr.no/thumb/654358.jpeg
View 1 Replies
View Related
Mar 16, 2011
I am having difficulty trying to change the format of selected date from date picker. This is a test so my code is very simple. Here it is.
[Code]....
View 1 Replies
View Related
Mar 18, 2011
Got some problems with a php script that outputs a jQuery script.
The purpose of the jQuery code is that when you select an item from the select field that other items need to be disabled(works correct in all conditions) and that at the same time text in corresponding divs' text are altered.The thing is that the script basically works.. however when you've made a selection only the disabling works everytime but the divs are only updated once, so you need to refresh the page if you want to do it again..[code]
View 1 Replies
View Related
Aug 3, 2005
I have an IFrame whose document is created completely by Javascript code at
runtime. The document in the IFrame accesses Javascript functions in the
top level document. This works fine most of the time. But every now and
then, when I hit the back button, the browser suddenly thinks the Javascript
created document in the IFrame is not from the same domain as the topmost
document, and therefore I start getting "permission denied" errors when I
try to access the top level document's Javascript functions.
If I look at the IFrame document's properties (Mozilla->This Frame->View
Info), it shows the expected URL with a domain name that matches the top
level document.
View 2 Replies
View Related
Oct 24, 2009
I'm working on a list with doctypes and fases. There are n types and n fases. The fases can be ordered by dragging them.
example:
[btn Append new type]
- a
- a.1
- a.2
[Code]....
I have a fancybox (lightbox) to append new doctypes and fases, but after appending either one, the functions dont work anymore (dragging and opening the lightbox of the appended doctype.
The HTML gets appended without a prob. But it seems that the initiation of the draggable <ul> and the lightbox links doenst work.
I tried adding Javascript to re-initialize the functions, but this doenst work.
How can i fix the prob that appended links with the right class show the lightbox when they are clicked, and how do i make an <ul> draggble after one is added?
p.s.
function appendFase(docTypeId,appendThis){
$(docTypeId).append(appendThis);
$(docTypeId).sortable('refresh');
}
gives error's...
View 1 Replies
View Related
Feb 6, 2010
I have a start date and end date text boxs. What I would like to achieve is when a submit button is clicked all the available dates between start and end dates should be displayed together with 3 check boxes next to each date (please see below). I am just wondering whether that'sachievablewith jquery, and if so, how I might be able to implement this.
Start date End date
View 8 Replies
View Related
Jul 9, 2010
Code:
h=0;
if (h > 0)
{
function hidestuff(){
document.getElementById('example').style.visibility = 'hidden';
}
[Code]...
If i want the function "show stuff to execute only when that variable is 0, what event should i use?
View 6 Replies
View Related
Jan 22, 2011
Here is what I have thus far...
[Code]...
But as soon as I throw in the onComplete stuff fancybox fails to work.
View 17 Replies
View Related
May 11, 2011
I'm looking for some javascript that'll toggle hidden content. As I'm not experienced in this, I want something which is cross-browser reliable - and I'm having trouble finding something suitable. Jquery has been suggested as an option... and I found something which appeared to do the job, apart from not validating as it uses a span to include the toggled content - which is a problem as I need to included block level stuff to be hidden. Also, it came as two buttons - show and hide - and I'd prefer a single button, or preferably a normal html link.
View 6 Replies
View Related
Oct 30, 2011
my code is:
$(document).ready(function(){
$(".caftor").click(function(){
$(this).hide();
$.ajax({
[Code]...
View 1 Replies
View Related
Jul 23, 2009
the photos are loaded quickly but with a weird "frame" or line box on the bottom half of the site. This only happens in IE7.
View 3 Replies
View Related
Apr 25, 2006
How do i use javascript to create some navigation stuff like when i click on pictures it opens a new set of stuff to click on?
View 2 Replies
View Related
Feb 14, 2011
I have added a booking form to a website with belongs to fastbooking.You can see a temporary website here. http:[url]....It works perfectly fine in Mozilla Firefox, Google Chrome, Opera and Safari but it does not load on Internet Explorer.On the other browsers the form loads todays date and the year is generated but on IE the date stays on 01-01 and no year is generated.I'm using wordpress as a cms.I think the code that is not loading is <body onLoad='start();'>But I'm not sure. The code of the year is
<select name='fromyear' class="input" onChange='update_departure();'>
<option value="0"></option>
</select> But since it's no just the year I assume its the onload code.
I tried to add the onload to the header function like this
<body onLoad='start();' <?php if(function_exists('body_class')) body_class(); ?>>
So now wordpress generates the following code when it loads the page
<body onLoad='start();' class="home page page-id-6 page-template page-template-default logged-in">
But sadly the date still does no load on Internet Explorer.
View 1 Replies
View Related
Aug 31, 2009
I am trying to use the jquey datepicker. I want to show the date chosen by the user in a <span> element with a particular format. However my code maintains the default format. What am I doing wrong?
[Code]..
View 3 Replies
View Related
May 26, 2011
We have a little callendar on our website. I have set the format of the date to "dd-mm-y" because I want the date to be saved europian, not american. When comfirming the form, the date is saved as 0000-00-00. The date shows correctly on the form itself. I have two scripts: Calendar.js and Calendar-en-GB.js. Calendar-en-GB.js contains the 'settings'. (Including date format). I can't figure out the problem and thought maybe one of you could. I have uploaded the scripts in one .zip file: [URL]
View 3 Replies
View Related
Sep 9, 2010
I want to change date format to insert date in mysql. I tried as below code
<script type="text/javascript">
$(function() {
$("#datepicker").formatDate('yyyy-mm-dd');
$("#datepicker").datepicker();
});
</script>
View 3 Replies
View Related