i'm trying to access data using ajax call in cakephp but getting 403 forbidden error, given below.
GET http://localhost/ec/bazar/Products/color_switcher/3 403 (Forbidden) jquery.js:6 x.ajaxTransport.sendjquery.js:6 x.extend.ajax53:251 colorSwitcher53:327 onclick i'm using this code to make call
function colorSwitcher(id){ var testid = id; $.ajax({ type: 'GET', url: '<?php echo $this->webroot; ?>Products/color_switcher/' + testid, error: function () { console.log("error in ajax call"); }, success: function (data) { $("#img-portion").html(data); }, }); } controller
public function color_switcher($testid = ''){ $this->layout= 'ajax'; } color_switcher.ctp
<?php echo "helooooooo"; ?>