PDA

View Full Version : javascript use



paul
05-09-2007, 08:48
hi, sorry if this is more of a javascript question than bluepark but i am just considering what is/not possible with the software.

on a product page (or indeed anywhere), is it possible using javascript to display product information in tabs and allow those tabs to be viewed without the need to reload the whole page - ive seen this elsewhere but not sure if this is javascript/possible with bluepark.

an example would be where there is a lot of information for a product (eg ingredients, use, description, application) which would, if displayed in a list, be too much info displayed on the page. so better to display in tabs but without the delay in reloading the page when each tab is selected.

many thanks

Rich
05-09-2007, 10:48
Although this isn't a built-in feature for product pages, it is indeed possible. The reason it's possible is because the Page Content field in the Product Editor may contain any HTML content, including JavaScript.

The tidiest way to achieve this would be to put the core JavaScript functions in a separate ".js" file, upload it to your webspace and place it in the HEAD section on the page. You can add lines to the HEAD section on either a per-page basis (via the Product Editor) or on every page (via the Template Editor).

Of course, this kind of work requires a reasonable knowledge of JavaScript as such functions generally need some "tweaking" to get them to display correctly. And remember, if you're debugging JavaScript - always use Firefox as it gives you much more information than IE. ;)

paul
05-09-2007, 11:02
hi, thanks for your reply. good news indeed.

why would the javascript go in the HEAD section? i have always thought, perhaps wrongly, that the head section displays at the top of the page. to display tabs in the centre column next to a product image i would have thought this would be included in the column section or a block within the column section? sorry im not up to speed on how the page layouts work yet.

Rich
05-09-2007, 12:15
why would the javascript go in the HEAD section? i have always thought, perhaps wrongly, that the head section displays at the top of the page. to display tabs in the centre column next to a product image i would have thought this would be included in the column section or a block within the column section? sorry im not up to speed on how the page layouts work yet.

By the HEAD section, I'm referring to the <HEAD></HEAD> section in the code (which is not displayed) - not to a position on the page.

This is where you would also put code such as Google Analytics etc.