I seek a simple way to call a php file using jquery.
The ultimate outcome has to do with a Magento site I am working on: http://bouquetsco.com/flowersplants.html ^^This page
This page displays products: 3 in a row.
<?php $this->setColumnCount(3); ?>
<?php $this->setColumnCount(2); ?>
^^This php code manually sets the number of product columns.
By default the page displays 3 wide, which looks fine until the browser window re-sizes down to tablet width (760px or so). When the website's design is tablet size (760px or so) I would like to display only two columns of products.
To do this, it seems one must use javascript to determine the window width, then run some php code depending on the browser-window width... like
this...
if ( browser-window-widith > 760) { get '3-column.php' }
else { get '2-column.php' }
This is grossly over-simplified. What would this code logic look like? How would one write this functionality?
Also, one could change the initial if statement to:
if (browser-window-width < 760) { get '2-column.php' }
else { get '3-column.php' }
====================================
There would exist two .php files (2-column.php, & 3-column.php) Each contains:
<?php $this->setColumnCount(2); ?>
or
<?php $this->setColumnCount(3); ?>
The code would call one file or another depending on the browser window width, (which would be found by the javascript) and thus result in
3-column product list for displays > 760px
and
2-column product list for displays < 760px