Help! Where Have I Gone Wrong with Conditional Statement
Hi
Hope you can help a less than newbie! We want the code to do the following:
1. Call external php file "productfile.php"
2. Check if "sp_field" value exists in the external php file.
3. If it exists then show "sp_field"
4. If product doesn't exist then don't show "sp_field"
Code we have so far that doesn't work is :-
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery.get('http://www.thewebsite.co.uk/productfile.php?linkid=<?php echo $CustomFields->field('sp_field',$listing,false,false);?>',function(available)
{
if(parseInt(available)==0)
{
alert('product no longer available');
}
},'html');
});
</script>
Can you see where it is wrong?