Jump to content
Killersites Forums


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About monkeysaurus

  • Rank
    Advanced Member
  1. It's possible to do something like this using the W3C's new file api, but it would not be a trivial job, by any means. And in any case, you'd probably need to fall back to the more traditional solution for those with lesser browsers, if they were a significant part of your user base. Here's some info on the new file api, in case you decide to follow it up: http://ajaxian.com/archives/w3c-publish-first-working-draft-of-file-api http://hacks.mozilla.org/2009/12/w3c-fileapi-in-firefox-3-6/
  2. The iframe tag should not be self-closing. Instead of: <body> <a href="#" onmouseover="show()" onmouseout="hide()">move</a> <iframe src="Untitled-2.html" width="300px" height="300px" id="ifam2"/> <iframe src="gallery.html" width="300px" height="300px" id="ifam1"/> </body> You should have this: <body> <a href="#" onmouseover="show()" onmouseout="hide()">move</a> <iframe src="Untitled-2.html" width="300px" height="300px" id="ifam2"></iframe> <iframe src="gallery.html" width="300px" height="300px" id="ifam1">
  3. Apologies Ben, I completely missed that part of the requirements. Yes, it is entirely possible to do this with jQuery UI. BEHOLD!
  4. Hi Ben, I feel a long-ish answer coming on! My first suggestion would be that in re-creating a jQuery accordion, you're re-inventing the wheel. jQuery UI provides an accordion widget that is functional cross-browser, keyboard-accessible, theme-able, has support for WAI-ARIA and much, much more. So unless you're planning to implement all of those features, this is almost certainly a better option for your client, and their customers. It is as simple to implement as: <script type="text/javascript"> $(function() { $("#accordion").accordion(); }); </script>
  5. Easy-peasy way, doesn't rely on navigator.userAgent (which can be spoofed): <!--[if lt IE 8]> <script type="text/javascript"> alert("You're using 7.x, please update your IE"); </script> <![endif]-->
  6. monkeysaurus

    Email validation

    Honestly, I wouldn't re-invent the wheel on this one. There are far too many edge cases to consider. There's a PHP class designed to validate email addresses here: http://code.google.com/p/php-email-address-validation/ And using it is as simple as: include('EmailAddressValidator.php'); $validator = new EmailAddressValidator; if ($validator->check_email_address('test@example.org')) { // Email address is technically valid } else { // Email not valid }
  7. The color plugin will work of course, but you can also use jQuery UI to animate background colours.
  8. Well, the next problem is on line 15: if (isNan(numGuitarStrings)) should be: if (isNaN(numGuitarStrings)) I would recommend downloading Firebug and working through the errors as they appear in the console.
  9. Hi, Firebug is showing an error on line 28: if (stringString.indexOf("dozen") != -1) should be: if (stringsString.indexOf("dozen") != -1) If you could fix that, we can see what happens after that.
  10. I've always used Themeroller in conjunction with jQuery UI - you can tweak the look in your browser, then download the specific package you need. There are pre-rolled themes there too. Once you've done this, it's a simple case of including the stylesheet in your page and making sure the paths are correct. Even if you use themeroller as a starting point, then tweak once it's in place, it's the quickest way to work with jQuery UI, for my money.
  11. As per the W3 spec, this isn't the purpose of the tag. The tag should be used to provide alternative content when a script is disabled; it shouldn't be used to tell the user to switch javascript on. What if the user can't switch javascript on? What if they're browsing on a mobile user-agent? What if they're using a screen reader, or a dozen other devices that don't support javascript? What about search robots trying to index your site? These days there's no excuse not to use progressive enhancement techniques; develop your site so that it's fully accessible with javascript off, then u
  12. Yes and no; it's actually much more than that. To understand 'this' in Javascript, you first need to understand that everything in Javascript is an object. Functions, events, DOM elements...all objects. In fact, Javascript is possibly one of the most object oriented languages around. In addition, every object must have an 'owner'. Let's say you're declaring a variable, thusly: var foo = 'bar'; // alerts 'bar' alert(window.foo); Well, you haven't really declared a variable at all! You've attached a property named foo to the window object. In Javascript, if you declare
  13. Hi William, Chrome on Windows is still taking me to the page rather than ajaxing in the content. Here's why. Using a 'submit' button When you click the 'continue' button, the browser attempts to carry out the default action - in this case, posting your form variables to creditCardAuthorize.php. Although you've written a piece of javascript that listens out for the button click event, the click event is continuing to bubble up the DOM, and the form is being submitted. You can prevent this by intercepting the form submit event and halting it in place. Something like this should do the
  14. Hi Patrick, The basic idea seems sound. In order to run an external program from PHP, you should look into the system, exec, and passthru functions. These will all do what you need to do.
  • Create New...