Page is a not externally linkable
glenrogers - 10:46 pm on Feb 4, 2013 (gmt 0)
I havent much of a clue what you mean.
I now have this as my js script. // whenever a link with category class is clicked
$('a.category').click(function(e) {
// first stop the link to go anywhere
e.preventDefault();
// you can get the text of the link by converting the clicked object to string
// you something like 'http://mysite/categories/1'
// there might be other methods to read the link value
var linkText = new String(this);
// the value after the last / is the category ID
var categoryValue = linkText.substring(linkText.lastIndexOf('/') + 1);
// send the category ID to the getProductData.php script using jquery ajax post method
// send along a category ID
// on success insert the returned text into the product-data div
$.post('showproducts.php', {category: categoryValue}, function(data) {
$('#info').html(data);
var totalRecords = $(data).length;
var pageSize = 10;
var numOfPages = Math.ceil(totalRecords / pageSize);
});
});
</script>
Is this what you meant?
I dont understand what to do in my showproducts.php file now!