Jump to content

thescientist

Moderator
  • Posts

    8,682
  • Joined

  • Last visited

Posts 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. 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

  3.  

    Sorry this is what it's like

          <script type="text/javascript">
         			$(document).ready(function() {
         				var dropDown = [" ","Run1", "Run2", "Testplan", "Rails", "Europa"];
                 var dropDownID = [" ","111111", "222222", "333333", "444444", "555555"];
         				$("#dropDown").select2({
         				  data: dropDown
         				});
                //Adding ID to dropdown menu
             $("#dropDown").change(function() {
             $("#dropdownID").val(dropDownID[$("#dropDown option:selected").index()]);
             });
    
             $(document).ready(function(){
               $("#dropdownID").keypress(function(){ 
                  $("#dropdownID").val(dropDownID[$("#dropDown option:selected").index()]);
               });
               });
              });
         		</script>
    <!--ID REF-->
    <br><br> Testrail Plan ID:<input type="text" id="dropdownID"><br><br>

     

    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)

  4. The Apache project recommends that instead of using .htaccess files, you put all directives in the main server configuration file, so that Apache does not need to scan for and process .htaccess files in every directory when someone requests a file.

     

    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

  5. The tutorials are essentially ES5. ES6 is a massive change in the language.

    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.

  6. 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.

  7. 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.

  8. Is Sql is working in PHP7?

    Please say then I can install from

     

    http://www.php.net

     

    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.

  9. 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.

  10. Gh, exactly like i said.... Bigger mess than I could possibly imagine.

     

    Thanks.

    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.

  11. 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.

  12. 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.

  13. 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).

×
×
  • Create New...