-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
problem with getting youtube video thumbnail in php
Adam replied to doforumda's topic in Javascript Help
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. -
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.
-
Do you know anything about AJAX?
-
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.
-
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.
-
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.
-
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?
-
Oh dear.. All you needed to add was the display:inline - I tested it with Firebug.
-
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.
-
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.
-
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.
-
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.
-
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);
-
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?
-
Could you post the code you're now using?
-
Can't run a php command in background on a remote box (using expect module)
Adam replied to aniraj's topic in PHP Coding Help
Have a try with popen instead. -
Can't run a php command in background on a remote box (using expect module)
Adam replied to aniraj's topic in PHP Coding Help
So the problem is only occurring when you're trying to remotely execute something - how are you actually executing remote commands? -
Can't run a php command in background on a remote box (using expect module)
Adam replied to aniraj's topic in PHP Coding Help
How exactly are you trying to use &? Try using exec - that just executes a given command but doesn't return the output. -
Help back engineering sort by and items per page dropdown - jQuery
Adam replied to HDFilmMaker2112's topic in Javascript Help
You want us to write a tutorial for you on how to create those menus? -
Use getElementById to return the input element's object, and then call the focus() method.
-
You misspelt disapproved in your comparison: if(val=='dispproved'){
-
Try adding display:inline to a shared class between the map tags.
-
Can't run a php command in background on a remote box (using expect module)
Adam replied to aniraj's topic in PHP Coding Help
Edit Never-mind, I just noticed you're already doing that. Are you running on safe-mode? -
You're missing a quote: month='".$month."
-
Can you show us the PHP making the query?