jQuery Mobile Dynamicly Appending to Listview via AJAX issue

Posted by:

With jQuery Mobile you can create a Listview of list items but I wanted to populate that list dynamically via AJAX. The problem I was getting is it would work fine when I loaded it the first time but then I wanted to nuke (clear) the list and repopulate it with new content. If you’ve gone through half the trouble I went through to get this to work then I know this is going to help you out! So I ...

Continue Reading →
0

timthumb and PHP thumbnails rotate with large images

Posted by:

I’ve been banging my head against the wall trying to figure out why large images were getting rotated when I made them into a thumbnail (either through timthumb or PHP’s imagejpeg). It turns out that with images that were in portrait the width and the height were swapped for very high resolution images (~3000 pixels wide and ~ 2000 pixels tall). So I wrote my own function that looks to see if the EXIF information says this is a portrait ...

Continue Reading →
0

AJAX made easy using jQuery

Posted by:

AJAX can seem daunting but it’s never been easier to implement with jQuery! So first, let me give my explanation of what AJAX is and can be used for. Imagine you have a piece of content you’d like to have updated every so often (e.g. an average number from a database), but you don’t want the user to have to reload the page to get the updated number. This is where AJAX comes into play – you can setup an ...

Continue Reading →
0

Swapping variables in PHP

Posted by:

I’ve created a short and sweet PHP function swap() to exchange/swap the values of two PHP variables. Here it is in action:

<?php
$cat = "cat";
$dog = "dog";
swap($cat,$dog);
echo "$cat goes meow and $dog goes woof"; //dog goes meow and cat goes woof
function swap(&$var1, &$var2) {
$tmp = $var1;
$var1 = $var2;
$var2 = $tmp;
}
?>

If you’re running this function a lot (e.g. millions of iterations) it’s actually faster to just perform the ...

Continue Reading →
0
Page 4 of 11 «...23456...»