PDA

View Full Version : How to insert javascripts into /homepage/default.tpl


dcwc99
11-22-2007, 05:39 PM
i tried to insert a currency converter javascripts to call the data from a website to mainpage...but it doesn't work.. anyone can help on this?

<a href=http://www.gocurrency.com/ id=gocurrencytable>Currency Converter</a><script src=http://gocurrency.com/v2/table_f.php?cur=USD;EUR;GBP;JPY;CAD;AUD&v=1> </script>

Micha
11-23-2007, 08:58 AM
You are missing quotes all over!

<a href="http://www.gocurrency.com/" id="gocurrencytable">Currency Converter</a><script src="http://gocurrency.com/v2/table_f.php?cur=USD;EUR;GBP;JPY;CAD;AUD&v=1"> </script>

here's a code:

<a href="http://www.gocurrency.com/" id="gocurrencytable">Currency Converter</a><script src="http://gocurrency.com/v2/table_f.php?cur=USD;EUR;GBP;JPY;CAD;AUD&v=1"> </script>

dcwc99
11-24-2007, 03:39 AM
wow it works! thanks so much!!

azednet
01-04-2008, 08:28 PM
why the adsense code dont show

Micha
01-05-2008, 10:53 AM
Where did you put your code?
What is the code you inserted?
What is the URL of your site?

Please be more specific about this.

azednet
01-05-2008, 02:31 PM
thank you,

the code adsense is:

<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxxxxx";
google_ad_slot = "xxxxxxxxxxxxxxx";
google_ad_width = 728;
google_ad_height = 90;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Micha
01-08-2008, 09:41 AM
Can you please share the URL of your website where you inserted the code?

Also, can you share exact code of your google ad sense?

Sola
01-14-2008, 11:35 PM
Can you please share the URL of your website where you inserted the code?Not everyone wants to post his url here Micha.

Micha
01-15-2008, 08:30 AM
Not everyone wants to post his url here Micha.

I can understand that, but than how would someone expect to get help.
In many cases the problem is different from site to site, and on most of them you need to see the code behind.

And if someone don't want to share his URL, well, in that case, I cant help much, except to say, Google and Yahoo ads always works when I insert them, and I have no idea why they don't work for you.

And to recommend reading of developer manual (templates section - http://www.vivvo.net/doc/v4/developer_manual/templates_folder.php) and w3schools (http://www.w3schools.com/)

Sola
01-15-2008, 06:09 PM
Google and Yahoo ads always works when I insert them, and I have no idea why they don't work for you.While appreciating your viewpoint, i don't see why there shouldn't be some sort of middle ground. Below is the original header file:
<div id="header">
<div class="header_image"><img src="{VIVVO_THEME}img/header.jpg" alt="header" /></div>
<vte:include file="{VIVVO_TEMPLATE_DIR}box/pages.tpl" />
<vte:include file="{VIVVO_TEMPLATE_DIR}box/dhtml_menu.tpl" />
<vte:include file="{VIVVO_TEMPLATE_DIR}box/search.tpl" />
</div>

I deleted this line:
<div id="header">
<div class="header_image"><img src="{VIVVO_THEME}img/header.jpg" alt="header" /></div>
</div>

From what's left, WHERE and HOW would you place the Google Javascript up there?

Or is this the wrong file? The JS is totally stripped in the output. Yet, it the same JS works in all the Default files for ARTICLES, etc.

Thanks.

Micha
01-16-2008, 08:04 AM
<div id="header">
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxxxxx";
google_ad_slot = "xxxxxxxxxxxxxxx";
google_ad_width = 728;
google_ad_height = 90;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<vte:include file="{VIVVO_TEMPLATE_DIR}box/pages.tpl" />
<vte:include file="{VIVVO_TEMPLATE_DIR}box/dhtml_menu.tpl" />
<vte:include file="{VIVVO_TEMPLATE_DIR}box/search.tpl" />
</div>

That's how I insert them inside header.

Sola
01-16-2008, 04:13 PM
Thanks Micha. Your post proved very helpful. Let me post my findings just in case it helps someone else down the road.

I went back to investigate, based on what you say works for you as posted above. I stripped out my Menu html and positioned the JS in the header file as you have it above. It appears and works fine.

I then started playing around with positioning it. Still fine.

As soon as I added my site-wide html menu ABOVE it, the JS disappeared again. When I placed the menu BELOW the JS, both the menu and the Google ad appeared. So, my temporary workaround is to keep the site menu below the Google ad for now, until I can play around with it to figure out what aspect of the menu is breaking the JS.

You were most helpful.