View Single Post
  #7  
Old 11-03-2011, 12:13 PM
larrypjr's Avatar
larrypjr larrypjr is offline
Junior Member
 
Join Date: Jun 2011
Posts: 23
Default

HI!

Thanks for taking the time to help. I appreciate it a lot.<smile>
What I'm trying to figure out is how to get regular javascript commands to work
on the same page as where we called it.

<script>
Ecwid.OnPageLoaded.add( // an Ecwid JS API call
function(page) { // this is anonymous function constructed right in place, but you use the named functions as well

// it is possible to react on different type of pages in Ecwid and their parameters
if (page.type === 'PRODUCT') {
alert('This code only runs when a product page is open');


document.write("Welcome to my world");

}
}

);

</script>


Good news: This works
Bad news: It opens up and works on a new seperate page

My questions:

1. How do I get it(meaning either a text statement or an image) to work on the same page (ie: 'PRODUCT') instead of opening on a new page as this does. (should I consider opening a window
on the 'PRODUCT' page similar to the alert? Or is there a simpler way?)

2. Is there a recommended way to address the text or image in CSS so that I might be able to style position, color, etc...


3. How do I address just the 'PRODUCT' page without going into an (if then) statment.
ie: page.type Tried function(page.'PRODUCT'). Didn't seem to work.


I realize these are pretty basic questions but important to my simple understandings. Thanks again for your help


<BTW> If anybody else is reading this post I would highly recommend upgrading to the 'SILVER' plan. I just started working with the 'Product Variations' and it's worth every penny of the upgrade. On top of that, you can get the 'agree to terms' box, and several other great tools for your cart. When you consider the API possibilities there really 'isn't much you can't do' with ECWID. I'm reminded of what my insurance salesman used to tell me about the price: 'Hardly seems enough' <

Last edited by Laurence Poulin; 11-03-2011 at 12:56 PM.