I have two .phtml files in magento, one which is used in the home cms page and is referenced like this:
{{block type="catalog/product_list" category_id="11" template="catalog/product/special-products.phtml"}}
then I wish to ajax;
<script>
function loadXMLDoc(pageNo)
{
var xmlhttp;
if (pageNo.length==0)
{
document.getElementById("productsDiv").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("productsDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","special-products-ajax.phtml?page_number="+pageNo,true);
xmlhttp.send();
}
</script>
<script>
//call after page loaded
window.onload = loadXMLDoc("1");
</script>
within this file (special-products.phtml) to access special-products-ajax.phtml which I've put in the same directory however the xmlhttp.status is returning as 404 (not found). I tried moving this file to a folder in the root directory "/scripts", the ajax worked but I didnt have any access to the Mage app. Please help me Im really stuck on this one.