Jump to content
#FlattenTheCurve ×

Xaotique

Members
  • Content Count

    582
  • Joined

  • Last visited

  • Days Won

    1

Xaotique last won the day on March 23 2013

Xaotique had the most liked content!

Community Reputation

27 Good

About Xaotique

  • Rank
    Prolific Member
  • Birthday 04/19/1992

Profile Information

  • Gender
    Male
  • Location
    Ohio, United States
  • Age
    23
  1. Your parameters aren't quite right for preg_replace_callback(). <?php $new_str = preg_replace_callback('/regexp/', function($m) { // $m is an array of the current match }, $str); ?>
  2. To get a new number each time without some sort of bad luck, I would usually suggest using a timestamp. It's in milliseconds in JS, so unless you go way overboard on a couple submits ... To skip the whole need of using random numbers to avoid caching, you could just use a post instead of get. $.post('/map_data.php', { 'mid': 1 }, function(data) { $('#summary').html(data); }); Then you need to use $_POST instead of $_GET, but caching won't be an issue. If you really did want a random number, PHP could generate that with rand().
  3. As an alternative to what's shown above, here's another option: <?php $start = 1; $end = 5; // Using str_repeat() for ($i = $start; $i <= $end; $i++) { echo str_repeat('*', $i) . "\n"; } // Going Both Ways $dir = 1; for ($i = $start; $i > 0 && $i <= $end; $i += $dir) { echo str_repeat('*', $i) . "\n"; if ($i == $end) $dir = -1; } ?> The First Option Output: * ** *** **** ***** The Second: * ** *** **** ***** **** *** ** *
  4. To pull the items of an array and append them to a string you would use: "your url ..." . $corpid[$x] Also note that you should probably check the array key exists, as you're doing 1 and 2 in your loop as $x when your array keys are 0 and 1. Try something more like .. // Number of elements in the array. $corpid_len = count($corpid); // Loop through starting with 0 and ending with the count - 1 for ($i = 0; $i < $corpid_len; $i++) { $url="https://api.eveonline.com/corp/CorporationSheet.xml.aspx?corporationID=" . $corpid[$x]; }
  5. $('#checkboxes input').change(function () { /* Your stuff */ });
  6. Without you giving us the value of $post_article, I would have to guess that there's a single quote in it causing your JS to fail. You would need to replace ' with \'.
  7. You are missing the period for $.getJSON(). If that's not your issue, you should check your JS console to see if you're failing to parse the return. Maybe output the return in your console and see what that is. You can just do a $.get() and $.parseJSON() if you want to be able to output the data as well as parse it.
  8. You just need something to tell which should show / hide. You can use the value in your above example and have that be the value of a parameter on the other selects. When onchange triggers, you can hide them all then show the one(s) you want. https://jsfiddle.net/aLkz2aw1/
  9. https://jsfiddle.net/xvfp1nqL/ You can just use the .hover() function in jQuery. You can also set an attribute like data-bg if you want to set a different background for each element you're hovering. You would have something like ... https://jsfiddle.net/xvfp1nqL/1/
  10. It looks like the only thing you're missing is getting the value of the input, or I'm missing what the question actually is? Here's what I think you're wanting. https://jsfiddle.net/bme5ahjs/
  11. Your ID for 'targettemp' has a space at the end causing your JS selector to fail.
  12. http://jsfiddle.net/y3j81fr0/ You can change the input type to text to see it happen. Just setting the value to: (new Date()).getTime()
  13. I use Geany as well. A very lightweight, free IDE and has plugin support for a few missed features. Also available in Ubuntu repos. (:
  14. JQuery is my only reason for learning any of it.
×
×
  • 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.