Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Posts posted by justsomeguy

  1. I'm sure there is, you just need to build an object that describes everything and your browser needs to be able to load everything.  First step is to use your developer tools to figure out what's going on.

  2. Well, if you don't have a web server then your options are limited.  Different browsers might place different restrictions on you.

    How do you access that HTML file, do you just double-click on it to open it?  What's the URL show?  You might want to open your developer tools and refresh with the Network tab open to see what it's doing, if there are any error messages they'll be on the console tab.

  3. It will help if you answer questions that we ask.  Are you looking at your browser's developer console?  Do you see the error message?

  4. Yeah, that's the only local variable that has been created by that line.  You can check the global scope if you want, or you can make a watch expression to watch a specific variable or value, or in my browser if I hover over scrollTop it shows a popup that has the current value.

  5. If that's PDO then it's exactly the same.  PDO isn't different based on which database driver is used, that's the entire purpose.  Different databases might have different capabilities, though, for example when checking the number of records that were returned.

  6. Yeah, that's one way to use them.  Even if you're only going to run it once though, it's still good to use a prepared statement.  If you need to run the same query with different data several times for some reason it's more efficient to prepare it once and then give it the data each time than it is to put the data in the query and run that each time.  MySQL only needs to build the execution plan once.

  7. Use your developer tools to set a breakpoint in that scroll handler to see what the values are.  With the code on your site now:

    if (document.body.scrollTop < 180 || document.documentElement.scrollTop < 180 || prevScrollpos > currentScrollPos) {

    In my browser, document.body.scrollTop is always 0 so that if statement is always true.  Use a breakpoint to see what's going on in your browser.

  8. Did you fix the syntax error in your code above?  The reason it doesn't work is because you have a syntax error.  That's why you need to look at your browser's developer console to see the error message.

  9. That plugin just uses a Javascript array of objects with various properties like title, URL, etc.  It just looks for keywords in the text in that object and shows the URLs.  If that's what you're looking for then maybe it's a good fit for you.

  10. Check your browser's error console, you have random punctuation in there.  You should really make an effort also to keep your code formatted and indented without a bunch of extra lines so that it's easy to read.

  11. Security isn't really an issue in the design of a data structure like an array or class (other than class member visibility).  Security in that involves authentication and authorization, which you haven't mentioned.  Issues like how and when the API and the data are accessible, if other processes running on the same machine can access data they shouldn't be able to, etc.  

×
×
  • Create New...