![]() |
Running a little java script in static page
Hello
I'm back into my cart again and was putting some of my old html pages into the static pages but the little calculation chart I have won't run and I guess that there is something in xcart that prevents this so need to know if there is a way around this or how can I put a simple link in the vert menu box which holds the static page links so it just opens up a new regular page outside the centre box- I thought of putting a link within the static page but prefer not to do this. Thanks in A Paul |
Re: Running a little java script in static page
So you want all of your static page links to open in a new window?
|
Re: Running a little java script in static page
I'd like all my statics to open up in the centre panel but xcart won't allow java scripts.I even tried putting the link in the footer with some code that would open a new window without all the browser stuff and of a smaller size but this threw a smarty error. I read somewhere that it's not good website practice to have new pages opening up everywhere so trying to avoid this.Guess they are called static for a reason.
|
Re: Running a little java script in static page
X-Cart has no problem with JavaScript, you just need to call it correctly. By default, embedded static pages DO open in the center panel...not sure what you are trying to achieve?
|
Re: Running a little java script in static page
OK
Here's what I'm trying to acheive: I'm trying to get my webpage with javascript to open up in the centre and still have the javascript working at the end of it. I can't do it which is why I was asking the question here. Here is the JS: http://www.vwspeedshop.com/pg/Engine%20Calculator.htm |
Re: Running a little java script in static page
You need to put the javascript in the <head> tag, which means you need to add it to customer/home.tpl. Then when you add the rest of the content to an embedded static page, it should show fine in the main area.
|
Re: Running a little java script in static page
In General Settings, enable 'Parse Smarty tags in the content of embedded static pages'
Add this script to your static page... Code:
{literal} Code:
<a href="http://www.vwspeedshop.com/pg/Engine%20Calculator" onclick="NewWindow(this.href,'mywin','600','600','no','center');return false" onfocus="this.blur()">Engine Calculator</a> Should do the job :) |
Re: Running a little java script in static page
Ok
I tried that with some success. When I click the link created by xcart in the lefthand column it opens the centre section with another link and when clicked produces a new window of given size but I have to have the page in a separate folder outside of xcart-if I try putting anything in the embedded bit via admin/static pages it causes all sorts of probs. Now I'm going to try and add some code to the link on my footer so it opens a small simple page |
Re: Running a little java script in static page
Well thanks guys.
I pasted Phils code into the customer/home file and the link code into the link in the footer and it now works fine. |
All times are GMT -8. The time now is 01:44 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.