Jump to content

thescientist

Moderator
  • Posts

    8,682
  • Joined

  • Last visited

Everything posted by thescientist

  1. It would certainly fall within the realm of server maintaince, of which there is a sub-forum here for that which I would recommend anyone to check out and ask questions there, but as mentioned, the W3Schools tutorials aim to focus concretely on web languages, not necessarily all the ceremony that goes along with that.
  2. can you provide an example? is it not firing at all? what devices? all of them?
  3. I would review their API a bit more, you seem to be mixing things up. If you need it, proxy goes in the init method https://www.browsersync.io/docs/api#api-init https://www.browsersync.io/docs/gulp#gulp-install reload is for updating browsers about changed files https://www.browsersync.io/docs/api#api-reload You probably want to follow something more like this example https://www.browsersync.io/docs/gulp#gulp-sass-css Maybe something closer to var gulp = require('gulp'); var browserSync = require('browser-sync').create(); gulp.task('serve', function() { browserSync.init({ server: "./app" // your doc root, source code, build output, whatever }); //the files to watch for changes, to trigger browserSync gulp.watch(["./app/*.html", "./app/*.css"]).on('change', browserSync.reload); }); gulp.task('default', ['serve']); though knowing more about your project structure (since I see PHP in there) would be helpful, re: your doc root, or www, etc output
  4. I think you would find a lot of value in properly indenting and formatting your code, which a good IDE or text editor would do for you. Aside from that, yes, you only need one $(document).ready function. This is jQuery's recommended way of initializing your javascript to be sure that the DOM has loaded and that all the elements that you would expect to be there are there and so it only needs to be done once. https://learn.jquery.com/using-jquery-core/document-ready/ Clean up your code again and try another pass at this, and make sure to think about what is happening, line by line. Write it out in psuedo-code if it helps first (I find it can)
  5. I would second this. Here is the Apache documentation that is helpful in implementing this through server configuration instead of .htaccess https://httpd.apache.org/docs/trunk/rewrite/avoid.html
  6. I don't see this approach as being a more readable or maintainable alternative, but here goes $value = $explodedUriCount === 1 ? $pageName : $explodedUriCount === 3 ? $pageType : '404';
  7. I wouldn't say that necessarily as that kind of wording may lead one to think that a lot of things that are in ES5 wouldn't be the same or might even be broken in ES6. In fact, there is no backwards incompatibility between the two and in fact most of what was added in ES6 is just syntactic sugar on top of what is already part of ES5. One way to put it is that all the ES6 features are essentially opt-in, so if you need them use them, otherwise nothing stops one from continuing to "use" ES5.
  8. Are you asking in the context of PHP7 vs NodeJS? Otherwise, you are comparing apples and oranges.
  9. adding anything will obviously impact performance, it's just to what degree and at what overhead. Every file from the server to your browser an HTTP request and of course the size of each payload will incur a cost, and then there's the cost to the browser to evaluate and execute it. That said, you could have problems with a slow SQL query, which could make the site slow and have nothing to do with JavaScript, so it's really all in how well you know the technologies and how you apply them to your application. Then, when there is a problem, it's about knowing how to use profilers, networking tools, and debuggers to identify and solve it.
  10. Consider integrating a service like Amazon's Simple Storage Service (S3) into your application if it relies heavily on managing / delivering files. Files would get uploaded to a bucket, and the path stored in the database. Use it with Cloudfront to get CDN capabilities too. https://aws.amazon.com/s3/ https://aws.amazon.com/cloudfront/
  11. are you checking for console errors? checking that data is what you expect it to be? checking the POST request that the browser is sending to verify what's actually getting sent across the wire? Does DataTables have an API you can use to get the data instead (that would seem more practical to me). In general, it's not clear from your post what "doesn't work" means since there's not much detail here to know what debugging you've done.
  12. I had no problems with my existing source code. No code changes had to be made on my part so PDO, Slim, JWT, etc all still worked for me. It was mostly updates to my Vagrant script (local env ) and development / production servers, to leverage this PPA for the packaages I used to upgrade PHP, Apache, and MySQL https://launchpad.net/~ondrej/+archive/ubuntu/php I'm using Ubuntu 14.04 as my base box. I relied heavily on my unit and integration tests to sanity test and assure confidence in my existing functionality and haven't had any regressions to report.
  13. Fwiw, I upgrade to PHP7 a couple months ago, both for my local development environment using Vagrant, and in AWS. No complaints so far and everything was easy to get work using. My project was pretty green anyway and was just a backend API to my UI, so I didn't have any good reference as far as performance and benchmarks.
  14. well, what's the code and what exactly doesn't work?
  15. the mess is as much of one as you choose to make it, fwiw. The DOM has an API for a reason. One might consider it to be more of a mess would doing it all "manually" by writing the DOM yourself. You should at least look into it, the code may be a bit more verbose but the clarity, predictability, intent, and readability will more than make up for it.
  16. you might want to try reposting and using the formatting tags correctly so it's easier to read the code. The syntax highlighting will probably make a huge difference in seeing where the issue are. Are you using any sort of editor for this work? Most editors / IDEs will have syntax highlighting and often highlight inline when there is an obvious syntax error.
  17. what have you tried? is this data coming back through Ajax? Is it already JSON when you get it?
  18. I would look into why that many AJAX calls are needed at all. That seems excessive even for a site that deals in big data, as their challenge would be in keeping the response quick and small. Others will look into technologies like Falcor or GraphQL, but still, that's a lot of requests. I would start with reviewing the architecture that requires that many calls in the first place.
  19. It sounds like you are asking for how it actually works, which is as Ingolme described; by using Javascript to change <img> tag's src attribute to the different image path. If you're unfamiliar with what that means, it may be helpful to start with the JavaScript DOM tutorials. http://www.w3schools.com/js/js_htmldom.asp
  20. Not sure what you're asking. Are you trying to get the Tryit Editor to work, or are you trying to run this locally? If you want to save the images locally you can do that with your browser. Right click on the image and choose Save As. Otherwise, please let us know specifically what the context is and what error / issues you are encountering. FWIW, the TryIt Example works for me (light bulb turns on / off).
  21. You're doing addition here, fyi. You probably mean to use . which is the operator for concatenation http://www.w3schools.com/php/php_operators.asp (string operators)
  22. W3Schools has a few tutorials on wiring up form elements to a form handling script written in PHP. Combined with the MySQL tutorials it should provide a good start if you haven't already reviewed them. http://www.w3schools.com/php/php_forms.asp http://www.w3schools.com/php/php_mysql_intro.asp
  23. you are missing a lot of information that would be really helpful. What about it isn't working? What are you expecting vs what is actually happening? What version of jQuery and jQuery mobile are you using? Are you checking for any errors in the browser's console? What have you tried?
×
×
  • Create New...