Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. +1 for this solution. Agreed. :-P Jazzman this is one of the best posts I've seen you make and I mean that as a compliment not as a back-handed insult. :-P
  2. Does your server have short tags enabled? Try changing it to <option <?php echo $sel; ?> value="<?php echo $row['name']; ?>"><?php echo $row['name']; ?></option> Or for readability, don't leave PHP. echo '<option '.$sel.' value="'.$row['name'].'">'.$row['name'].'</option>';
  3. Ah good. Well it still seems like NULL has a good purpose there then. It's something you don't allow the argument to be. *shrug*
  4. Yes, it will. In fact that's the best way to do it. Have one php file for your nav bar, and check what page you are on, then have it output certain code based on that.
  5. I agree the OP's solution is way off. That is pretty much the opposite of what we're both saying to do.
  6. function myFunc($arg1, $arg2=NULL){ if($arg2 == NULL){ $arg2 = array('Some other data', $arg1, 'more data'); } [...] return $retVal; } $myVal = myFunc(1); How would you do this sort of behavior without comparing against NULL?
  7. I'm not on about the function definitions.. Then what are you talking about? I said you should not run jquery code outside of the doc ready. If you guys both interpreted that wrong fine, but that's what I said.
  8. Where did I say it was a requirement?? See above.
  9. There is nothing in your code that has anything to do with "start". You CAN define it outside of doc ready. You have to. Then you INCLUDE that on each page. Then in your document ready you CALL it. Read what I said. "You should not run jquery code outside of the document ready function." You SHOULD NOT RUN jQuery code... Should not. Run. Not "cannot define". Not "will burst into flames if you define". Geez. And no, people aren't going to be friendly when you ask questions that can be answered by google.
  10. Because if you try to execute javascript before the document is ready, you can and likely will run into problems. I have used jQuery for years and NEVER needed to run jQuery code outside of the document ready block. Show me an example of code where you needed to. I'm not talking about defining a function, I'm talking about executing one, like the OP is trying to do.
  11. This is a forum to get help, not to get people to write your code. "Appreciate if you can give me the coding.." it doesn't matter how many nice words you put, it's still rude. You need to try on your own. Do you know how to read data from your database?
  12. Include it the same way you do the jquery library. <script type="text/javascript" src="file.js"></script> or something.
  13. Think about what you wrote originally, and what you just wrote. (Off topic: 5,000th post? Time for a break.)
  14. Do you want it in an HTML table or just plain text output like that? You should really restructure your arrays but given the basic idea you have now, try this: <?php echo '<table><tr>'; foreach($title AS $key=>$text){ echo "<th>$text</th>"; } echo "</tr>"; foreach($date AS $key=>$d){ //This assumes you make $date a proper array. echo '<tr>'; echo '<td>'.$d.'</td>'; foreach($title AS $tk=>$text){ echo '<td>'.$price[$tk][$k].'</td>'; //You'll also need to make your price a proper array. } echo '</tr>'; } echo '</table>'; ?>
  15. Save the code as an external file, and then include it on both pages. You should not run jquery code outside of the document ready function.
  16. Oh come on, don't use the T-word man.
  17. I disagree with your disagreement! So there!!!
  18. $cols = array(''nav_home', 'nav_project', 'nav_forum', nav_db', 'nav_contact', 'nav_faq'); foreach($cols AS $c){ $val = $$c; mysql_query("UPDATE $lang_ro SET val = '$val' WHERE var = '$c'"); } I think that should work.
  19. I still like agree/disagree.
  20. Are you seriously still suggesting *I* use my time to add that code to the manual? Why don't YOU do it?? It doesn't matter what you do with a for loop, you need to understand the syntax. The fact that you put 3 for each after one another indicates YOU don't understand the syntax and should learn it. Read the links, they're good.
  21. When you don't know what code does, look it up in the manual. http://php.net/function here.
  22. You should install firebug and use it. It's the easiest way to debug your javascript. I have never used replace, but as I said before you can use any javascript WITH jQuery. You don't do anything special to it. The code as it's written looks fine so you need to use a debugging tool to help you.
  23. I've never seen replace, and a quick google didn't turn up anything for jQuery. Do you have firebug installed?
×
×
  • 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.