Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. What's the HTML structure you're working with? Looks like the script is returning multiple image paths, and you're setting them all as one long string to the src attribute.
  2. Well the AJAX isn't the difficult bit -- AJAX is in theory is very simple, and jQuery.ajax makes it even easier. All you need to do is set a timer interval to execute an AJAX request to a PHP script, that would query the database for the status of the user's friends and return the data in JSON format. The JS would then receive that data and update the HTML to match the new statuses. The logic is fairly simple, just tackle it one step at a time. If you get stuck, by all means post here with a specific problem.
  3. Do you know anything about AJAX?
  4. How about "Regarding Web Services"? That's about the best we can do, since we have no idea what the article covers regarding web services.
  5. To add to that, if this is a JS-based chat room like most are, you will need to use AJAX to periodically send a request to the server to check their last activity.
  6. That site uses jQuery to add the effects to the inputs. Have a read up and learn some of the basics, it shouldn't be difficult to achieve what you want. You'll have a hard to time trying to animate the colour change with vanilla JS though.
  7. I was in favour of JSON, but it looks like you're generating it yourself. Unless the PHP you showed isn't all of it, I can spot an error. You're missing a closing "]" for the cell array: $json .= "cell:['".$row['Status']."','".$row['uname']."'"; And you're missing a closing "}" to end the object: $json .= ",'".addslashes($row['country'])."'" That's why I asked to see the actual data in its JSON format, to see if there was a syntax error. Edit Also - where do you execute the SQL defined in $sql?
  8. Oh dear.. All you needed to add was the display:inline - I tested it with Firebug.
  9. Since this a modal pop-up you shouldn't place the code within the head of your document, as the body's HTML hasn't been constructed yet. Instead you should place it just before the closing body tag. This means you escape waiting for the onload to complete, but the DOM structure exists for you to make adjustments.
  10. Look at other sites- a lot link to a separate page but still retain the header and footer. A very simple way to achieve that, is by placing your header and footer mark-up within two separate files and including them with PHP before and after your echos. Very simple example: <?php require_once 'templates/header.php'; ?> <h2>Example Page</h2> <p>The header and footer are dynamically included into the page.</p> <?php require_once 'templates/footer.php'; ?> This approach also allows you to avoid duplicating the mark-up, so you don't have to make the same change across multiple pages. I don't know if you know much/any PHP, but it's not difficult to implement this, as you can see from the code above, to save yourself a lot of hassle and improve the consistency of your site's layout. You could also improve on it, using variables to dynamically set the title, description, etc. Bottom line though, you shouldn't be resorting to JS in order to get around problems like this.
  11. You shouldn't rely on JS for validation of your forms. By all means have both, to save the user submitting the form only to find out they have entered fields incorrectly. But you should always have the server-side validation there, as the user can disable and modify the client-side JS.
  12. If you're using AJAX, then I'm assuming you're connecting to a PHP script. Why not just have PHP generate the date from there? Or if you want the date to be selectable / relative to the client-time, then you could pass in a unix timestamp (which is much easier to generate with JS) and again let PHP handle the formatting.
  13. The first child is a text node for the line-break (see here for better explanation). You're better off using the children object which doesn't preserve white-space as nodes: alert(feed_1.children[0].id);
  14. Okay. Can you provide the actual data in its JSON format this is being used with? $sql = "SELECT Status,uname,countryif ($rc) $json .= ","; $json .= "\n{"; $json .= "Status:'".$row['Status']."',"; $json .= "cell:['".$row['Status']."','".$row['uname']."'"; $json .= ",'".addslashes($row['country'])."'"; This looks a little odd to me. Could you not use json_encode?
  15. Could you post the code you're now using?
  16. So the problem is only occurring when you're trying to remotely execute something - how are you actually executing remote commands?
  17. How exactly are you trying to use &? Try using exec - that just executes a given command but doesn't return the output.
  18. You want us to write a tutorial for you on how to create those menus?
  19. Use getElementById to return the input element's object, and then call the focus() method.
  20. You misspelt disapproved in your comparison: if(val=='dispproved'){
  21. Try adding display:inline to a shared class between the map tags.
  22. Edit Never-mind, I just noticed you're already doing that. Are you running on safe-mode?
  23. You're missing a quote: month='".$month."
  24. Can you show us the PHP making the query?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.