-
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 GoodAbout Xaotique
-
Rank
Prolific Member
- Birthday 04/19/1992
Profile Information
-
Gender
Male
-
Location
Ohio, United States
-
Age
23
-
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().
-
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: * ** *** **** ***** **** *** ** *
-
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]; }
-
$('#checkboxes input').change(function () { /* Your stuff */ });
-
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 \'.
-
Not getting return values in $getJSON object
Xaotique replied to Hussam7102's topic in Javascript Help
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. -
jQuery Show/hide select based on dropdown selection
Xaotique replied to toolman's topic in Javascript Help
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/ -
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/
-
Get function php script - foreign character conversion
Xaotique replied to peterlu's topic in Javascript Help
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/ -
Which PHP Editor do you think is the best? [v2]
Xaotique replied to Daniel0's topic in Miscellaneous
I use Geany as well. A very lightweight, free IDE and has plugin support for a few missed features. Also available in Ubuntu repos. (: -
JQuery is my only reason for learning any of it.