Jump to content

prestonwinfrey

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Everything posted by prestonwinfrey

  1. Use jQuery's next() function. $(function() { $('.follow').click(function() { var name = $(this).attr('name'); var info = 'test=' + name; var $this = $(this); $.ajax({ type: "GET", url: "yes.php", data: info, success: function(data) { $this.next('.test_results').html(data); } }); }); });
  2. You cannot access this in removeItem without passing it as an argument. <a onclick="removeItem(this)" class="button"> function removeItem(obj) { $(obj).parent().remove(); }
  3. Problem is is_int("10") would return false and GET is returning a string Maybe if(isset($_GET['category']) && ((int)$_GET['category'])==$_GET['category']){ } Could you cast the variable as an integer and then validate using is_int() or would that return true regardless because of the cast?
  4. The arrow shows up for me in the link you provided. (Google Chrome 11)
  5. It works with relative positioning as well. Here is an example: http://jsfiddle.net/YYZw5/
  6. <script type="text/javascript"> var count = <?echo $_GET['counter'];?>; var auto_refresh = setInterval( function () { $('#match_main').load('match_engin.php1?counter=' + counter, function () { counter++; }); }, 10000); // refresh every 10000 milliseconds </script>
  7. You are only fetching the first row into the array. $rows = array(); while($row = mysql_fetch_array($result)) { $rows[] = $row; }
  8. Ideally, you would use divs and position them accordingly via CSS. An easier approach would be to create a table as such: <table> <tr> <td>Pic</td> <td>Pic</td> <td>Pic</td> <td>Pic</td> </tr> <tr> <td>Title</td> <td>Title</td> <td>Title</td> <td>Title</td> </tr> <tr> <td>Pic</td> <td>Pic</td> <td>Pic</td> <td>Pic</td> </tr> <tr> <td>Title</td> <td>Title</td> <td>Title</td> <td>Title</td> </tr> </table>
  9. You cannot define a function within a function. You need to separate the roundnumber() and calc() functions. Within calc(), you can call roundnumber() to return the results you are looking for. For further assistance, please post your HTML code.
  10. One quick thing I noticed is the way you're setting values. For example, you're doing this: document.getElementById("state").value = ("AL"); You should be doing this: document.getElementById("state").value = "AL";
  11. I just wanted to add that you can substitute a number for a boolean in the loop attribute of the embed tag. So you would add loop="3" to the embed tag if you wanted the sound to loop through three times.
  12. You could just add loop="true" to your embed tag.
  13. Use the onchange event instead of the onclick event to call your function. Attach parentheses to your function call which be empty if you are passing no parameters. You need to use "==" (is equal to) in your conditional statement to determine if what is on the left of the operator is equal to what is on the right. You don't need to enclose either side of the argument in parentheses or semi-colons. Make sense? Let me know if you need any further assistance. <script type="text/javascript"> function calc() { if (document.getElementById('ship_country').value == 'United States') { alert('Hello World!'); } } </script> <select name="ship_country" id="ship_country" style="min-width:200px;" onchange="calc()"> <option value="" selected></option> <option value="United States">United States</option> <option value="Canada">Canada</option> </select>
  14. No problem. I was also able to get it to work using what I told you try in my first reply. <html> <head> <title>Select Test</title> <script src="jquery-1.4.2.min.js"></script> <script> $(document).ready(function() { $('#firstSelect').change(function() { alert($(this).val()); }); $('#secondSelect').change(function() { alert($(this).val()); }); }); </script> </head> <body> <select id="firstSelect"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <select id="secondSelect"> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select> </body> </html>
  15. How about this?: var str = $("#pm_sources:selected").attr('value');
  16. <script> document.onclick = getEl; function getEl() { alert(window.event); } </script>
  17. If I understand what you're trying to do, I believe I know how you can solve your problem. Using the JavaScript framework jQuery, you can use the getScript() event (http://api.jquery.com/jQuery.getScript/) to dynamically load JavaScript after the page has loaded. Inside of the dynamically-loaded JS file, you can bind events using jQuery's live() function (http://api.jquery.com/live/). This allows you to apply events to elements in the DOM that were previously loaded or later added. Let me know if you need any further assistance.
×
×
  • 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.