-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Javascript with AJAX and maybe an anchor tag to control URL?
Adam replied to treeleaf20's topic in Javascript Help
You can use JS' location.hash or window.location.hash to modify that part of the URL. Edit: Just to add, the surrounding anchor really should be reserved for non-JS functionality. -
Javascript with AJAX and maybe an anchor tag to control URL?
Adam replied to treeleaf20's topic in Javascript Help
Believe they alter after the hash don't they? Don't have FB accessible at the moment so can't check for sure. -
switching to another tabs of jquery the form validation
Adam replied to thenesh's topic in Javascript Help
Create the function(s) to validate each form, and as the "click" event is called on the tabs menu just call the correct validation function. If it returns true display the next form, else handle the error and and stay on the current tab. Can't really give you much more help though without seeing the code. -
Click the examples tab, second example... http://docs.jquery.com/Ajax/jQuery.get
-
It's probs easier than you think.. <?php $mins = date("i"); if ($mins >= 0 && $mins < 30) { $timestr = date("H").':30'; } else { $hour = (date("H") == 23) ? 00 : date("H")+1; $timestr = $hour.':00'; } $timeleft = strtotime($timestr) - time(); ?> <script type="text/javascript"> var timeleft = <?php print $timeleft; ?>; window.onload = function() { timer = setInterval(function() { timeleft = (timeleft == 0) ? 1800 : timeleft-1; document.getElementById('timeleft').innerHTML = Math.floor(timeleft / 60) + ':' + Math.floor(timeleft % 60); }, 1000); } </script> <span id="timeleft"><?php echo floor($timeleft / 60) . ':' . floor($timeleft % 60); ?></span>
-
Yeah, exactly the same..
-
What's your problem first?
-
I actually had this laying around (minus a few modifications to fit your needs). It's really simply (and a bit hacky to be honest), but you should be able to use it as a starting point... <?php $mins = date("i"); if ($mins >= 0 && $mins < 30) { $timestr = date("H").':30'; } else { $hour = (date("H") == 23) ? 00 : date("H")+1; $timestr = $hour.':00'; } $timeleft = strtotime($timestr) - time(); ?> <script type="text/javascript"> var timeleft = <?php print $timeleft; ?>; window.onload = function() { timer = setInterval(function() { timeleft = (timeleft == 0) ? 1800 : timeleft-1; document.getElementById('timeleft').innerHTML = timeleft; }, 1000); } </script> <span id="timeleft"><?php echo $timeleft; ?></span> seconds left Edit: corrected a bug in the code.
-
He's validating the extension too.
-
How to create dll file and perform different operations
Adam replied to zohab's topic in Other Programming Languages
You may have some success with COM, but being as DLLs are *Windows* library files it may be a bit tricky. -
Actually it does need to use 'AND' / '&&'. Puzzled my brain for a minute two but if you think about it in English; "if it doesn't equal this, and it doesn't equal this.." it makes more sense. Using OR would always cause it to fail because it would always not match one or the other; "if it doesn't equal this, or it doesn't equal this". Also you could use a simple regular expression to reduce the amount of conditions: !preg_match('/audio\/mpe?g/', $mimetype)
-
Nadeem has actually tried to make love to drupal y'know? He knows his stuff.
-
Well without actually seeing the site can only guess as to what's happening. As I said though, it's quite possible the "onsubmit" event is attached to the form else where in the JS.
-
Haha I first spotted Saddam! .. near to Hitler.
-
Could only take wild guesses that wouldn't really get us anywhere. As JAY6390 says, post the relevant code.
-
Applications which allow your Development team to work more Efficiently
Adam replied to SchweppesAle's topic in Miscellaneous
Perhaps an installation issue there, for me it spits out an error. -
Applications which allow your Development team to work more Efficiently
Adam replied to SchweppesAle's topic in Miscellaneous
I've been using CVS for over a year now and can only really think of 1 -perhaps- bug. It's just pretty limited I think. -
Applications which allow your Development team to work more Efficiently
Adam replied to SchweppesAle's topic in Miscellaneous
Plenty of version control software out there.. CVS, Git, Subversion.. We've recently started using Git at work over CVS and I definitely see the benefits, perhaps not worth the hassle of setting it up though if it would only be used minimally (Git over CVS / Subversion that is). -
Heh better than me, I can only name about 20 or so. I recognize a lot of them but can't seem to put a name to the face.
-
I agree that the outer glows on the logo do look odd and are a bit awkward on the eyes. Also the navigation I didn't actually see until jcombs_31 commented on it; kinda looks like you'd ran out of inspiration when you came to that part. Not bad overall though, quite vibrant and fresh looking.
-
Senior PHP Developer Position Interview Questions
Adam replied to hadoob024's topic in Miscellaneous
nadeemshafi9 strikes again.. -
Ah okay, fair enough. Well then to be honest I'd look at either using the <marquee> tag or finding another script; with the way this one works it'd basically need completely re-writing to support left to right scrolling.
-
I think I kinda get what you mean. My guess would be that there are 'submit' events attached to the forms else where in the code base which is triggering the AJAX functionality and suppressing the form actually submitting to another page. Can't obviously speculate how or where though.
-
You can't pass a date string to the Date() object like that. You can just remove all the date object stuff though and compare between the startdate and enddate variables: var startdate = "2009-11-01"; var enddate = "2009-11-04" ; if (startdate > enddate) { alert ("Error !") ; } (...) If you have a good read up on the Date() object you'll understand how/when to use it better. There was also a missing quote after: "Error !