Jump to content
Larry Ullman's Book Forums

HartleySan

Members
  • Posts

    3047
  • Joined

  • Last visited

  • Days Won

    243

Everything posted by HartleySan

  1. I don't think you need to use JS for this, but you do need a way of recording the logo used from page to page so that you can alternate. A cookie is fine, of course, but I'd probably just use a session variable instead. All the same, it all works fine.
  2. Looks real good, and I think you definitely learned a lot from this thread, so nicely done. Thanks for sharing the resulting code too.
  3. Google "Git on Windows". There is a command-line program you can download that works like the Unix Shell. Also, it's not that hard, and there are plenty of tutorials. Plus, you can play with it endlessly with files that don't matter before you actually start using it.
  4. Sounds like any version control system would solve your problem. Have you looked into Git?
  5. Yes, that sort of thing can be frustrating, and anyone that has tried to set up their own server has undoubtedly experienced similar woes on many occasions (I know I have). When it comes down to it, it can be really frustrating as well when you realize the whole problem is some minor incompatibility or cruddy documentation that doesn't clearly explain what to do, and as a result, you forget to execute one command. I guess what I'm saying is that most of us aren't idiots, but it can be really confusing and frustrating. Well, here's to feeling your pain (and the eventual elation when you finally get it working).
  6. Glad to hear. You're right in that there is always a next level, but there is a point at which you do more or less plateau, and at that point, you become the one creating the next level to some degree.
  7. Well, best of luck, and ask any questions if you have them.
  8. Looks solid to me, and I think you see the real value of it, which is creating a generic way to handle any number of similar clicks. Nicely done.
  9. No, I don't. It's "fun" and can be used to create real applications, but I don't think it'll ever replace PHP.
  10. It completely depends on the employer. Bigger code shops are likely going to have a more strict division between front-end and back-end. Smaller shops will likely be more lax and have everyone doing a bit of everything. Personally, I love having my hands in both worlds. I sometimes got annoyed at my last job that I had to be strictly front-end, as I was just as capable (if not more capable) and much faster at doing the back-end work in Java than my co-workers, but I wasn't allowed to cross over into that world because I was a "front-end dev". As such, I much prefer where I am now because it's a smaller place where I pretty much get to run the show and I get to do everything. When I get to more or less control the whole codebase is when I feel the most comfortable. Anyway, to each their own, and the way I see it is if you're desperate to just get your foot in the door and start gaining experience and knowledge, don't be too picky; take what you can get and run with it.
  11. It's not bad practice at all to dynamically set data attributes with PHP. By all means, you should if the situation calls for it. Also, like I recommended in #1 in my previous post, I think it would help you if you attached the click handler to the document object for this page. Also, what code did you try to use to get the flag to work? Thanks.
  12. I think it depends on what type of work you want to do in the web dev industry. In general, there are two camps: front-end and back-end. If you want to do front-end, focus on your JS skills, particularly your ability to use not just jQuery, but lots of other JS libraries like Backbone, Angular, etc. (I'm not saying I personally like these libraries, but they are the skills that most employers seek these days.) Also the ability to use Grunt and a SASS compiler, etc. is nice to see. Of course, you are expected to have a mastery of Ajax, event handling, etc. As for back-end, I think someone like Antonio would be more suited to answer that question. As far as I can tell though, like front-end, back-end employers want to see how familiar you are with using various back-end frameworks. Certainly, Yii knowledge might be something that employers seek. Also, the ability to use Vagrant, and comfort with configuring a server and doing things from the Unix shell is ideal. As for showing off those skills, you could make simple, fun little websites using various libraries, etc. Of course, if you're confident in your skills and really want to show off, then do something special, but I think the above is a bare minimum. Now, with all that said, when I worked as a front-end dev before, we had a bunch of more junior devs on the team that were not as strong with JS and other front-end technologies, and as a result, they didn't make as much money, etc., but they still had a job, and for those that were motivated, they had the ability to work hard, code all day, and most importantly, learn from more senior devs, which could help them reach a senior role someday, if they desired. Does that help?
  13. There are no events, per se, but there are callback functions for things like ob_start, etc. If you think about it though, events don't mean as much for a server-side language, although server-side languages like Node.js utilize event-like structures for things (since Node.js is intended to function like JS on the server side).
  14. To get my first breakthrough into the web dev industry, I create a one-page HTML page for my portfolio. I had it on a domain that I had up at the time, even though the domain itself was for something completely unrelated to my portfolio. I then put an Apache user name and password on the page so that only people who I wanted to provide access to could see it. For the portfolio itself, I provide a screenshot for each project / code snippet (there were 7-8, I think; some really short and simple just to illustrate one skill that I wanted to show off), and the screenshot linked to the actual site/demo. Below that, I put a link to a .ZIP file with all the code in it, and then below that, I put a bulleted list of the main points I wanted to emphasize for the portfolio piece. GitHub is of course an option, but I feel like going the extra mile to create something of your own means more. I honestly don't know if employers picked up on that, but all the same, I did get a job and my breakthrough into the industry, so it seemed to work for me. Shortly thereafter, I took the portfolio and the domain down, and I haven't needed it since, but still, it was invaluable for that first chance.
  15. HartleySan

    Long Time, No See!

    Antonio, I totally know what you mean about the command line. It's intimidating at first, but once you learn it well, it's hard to imagine how you ever got by without it. On a daily basis, I SSH into my work servers so often that I don't even know how I would do my job without a command line. Also, I know what you mean by being super busy. I'm super busy as well, as I'm pretty much the only developer on my team, and while hectic sometimes, overall, that is the productive, good kind of busy, I think. It sounds like you've grown a lot since joining the workforce, and as long as you always stay hungry, I see no reason why you won't be at the top of the dev stack leading the whole show one of these days. Stay hungry, happy and healthy!
  16. another_noob, I think you're on the right track with your code and implementation. Just a few things I would recommend: Nowadays, I almost always attach my click handler to the document, as that will catch everything in the entire document via evt.target (or window.event.srcElement in old IE). The one caveat to this approach is that on Apple iDevices, only clicks on a links or form inputs will bubble up to the document. Kind of annoying, but not too hard to handle as long as you go into your code expecting that. Also, because all clicks will bubble up to the document, I generally check the class on an element to ensure that I have what I want. When I have a bunch of similar buttons and I need to be able to differentiate them for specific actions, I will often use data attributes so that I don't have to rely on the id attribute to distinguish something. (In other words, I can better use the ID attribute for its intended purpose, and not tie it up with a bunch of JS functionality.) For example, I might add data-id="value" to each element where value is some simple string that you send to the PHP side for processing. Instead of actually disabling the buttons, you can easily create a flag that, when set to true, does not allow for processing. It's easier to code, and more true to what I think you want to achieve. Rolling all of the above together, I might implement what you're doing as follows: var btnProcessing; //Must be available outside the scope of the event listener to always retain its value. addEvent('click', document, function (evt, target) { //target is the button clicked if (hasClass(target, 'button') && !btnProcessing) { //If class of "button" and not currently processing another request btnProcessing = true; //Flag to denote processing post({ url: 'modules/action.php', params: { action: attr(target, 'data-id') //Value of the data-id attribute attached to the button }, success: function (html) { //HTML returned from PHP script qS('.placeholder_div').innerHTML = html; //qS = document.querySelector alias btnProcessing = false; //Reset flag to allow for processing } }); } }); Please note that the above code relies on my custom-built JS library, which is jQuery-esque, but much lighter and more efficient. Nevertheless, I think the parallels to jQuery are apparent enough that you can easily convert the code over.
  17. HartleySan

    Long Time, No See!

    Yes, there are many reasons to like and be interested in Japan. It's definitely a lot different from Western countries (though not always in the weird ways people generally think about it).
  18. Hello, and welcome to the forums. "output" works without declaring a variable because of a very bad idea originally implemented in IE and later spread to other browsers. Here's more info about it: http://stackoverflow.com/questions/3434278/do-dom-tree-elements-with-ids-become-global-variables In short, you should always use document.getElementById and a declared variable to grab a hold of and retain a DOM element.
  19. Try adding parentheses after your e.preventDefault statement and see what happens. Also, if you're doing that, you shouldn't need the return false at the end.
  20. I have a set of prepared statement functions that I wrote that do something very similar. The SO answer is a basic (but not ideal) solution to the problem of being able to write a function that allows you to execute a prepared statement on any query with a dynamic number of parameters. Point being, I think the code in the SO answer (by the author's own admission) is a bit sloppy, but the concept is sound and it works.
  21. HartleySan

    Long Time, No See!

    Yes, I still fondly think about all the wonderful dining experiences and tasty food I had with friends in Japan, and I do miss it, so I fully understand where you're coming from. Best of luck with your C++ issue.
  22. Hello, and welcome to the forum. Were there any errors reported in your browser console? Could you please provide the relevant code?
  23. HartleySan

    Long Time, No See!

    Interesting stuff. Thanks. More as a coincidence than anything, but I was born in the same year that you got your first desktop computer. Also, the power of computing devices these days (especially mobile devices and smartphones) is quite impressive. I saw your other post about the DLL, and unfortunately, I have no experience making DLLs, so I can't really answer your question. Years ago, I was into C and C++, but it's been a while, and I've been so focused on the web side of things, that I haven't gone back since. C++ was my first language. I first starting learning it my sophomore year in high school. I then went back and played with C to get a better foundation, and then moved onto Java thereafter. To this day, I still very much dislike Java (and I still can't explain why), which is unfortunate, considering how many high-paying Java jobs there are out there. I have learned to be content doing what I want to do though, even if it's not that high-paying. Plus, I do feel like a lot of businesses are looking more and more to remove themselves from Java and move to the web for their systems. As such, I don't think there will be a shortage of web jobs for quite a while. The only problem is that so many of these businesses are so entrenched in Java (and sometimes COBOL and whatnot) that they can't just switch like that. Anyway, it is all very interesting. Thanks again for sharing. P.S. Out of curiosity, what parts of Japan did you frequent? Also, did you learn much Japanese?
×
×
  • Create New...