Office Live Small Business Community Forums

Trouble inserting script

Last post 08-24-2008 8:13 PM by royster. 7 replies.
Page 1 of 1 (8 items)
Sort Posts:
07-26-2008 1:51 PM
jvolzer Joined on 06-11-2008 Posts 24
Trouble inserting script

I'm trying to insert s short piece of code from a site that will add some headlines to my page.  I'm inserting it using the HTML module.  Here's how the code looks after inserting it (OL adds the defer tags):

 

<script type="text/javascript" src="http://www.freshcontent.net/cycling_news_feed.php" defer="defer"></script> 

 When I vew the page, nothing appears where the headlines should be and the "loading" animation in Firefox just keeps running and running.  It doesn't come up in IE either.

The page I'm inserting to is www.calhouncycling.org/test2.aspx 

 Can someone help?

08-19-2008 8:04 PM In reply to
jvolzer Joined on 06-11-2008 Posts 24
Re: Trouble inserting script

Can anyone help with this?

08-19-2008 8:37 PM In reply to
royster Joined on 02-12-2008 Posts 1,478
Re: Trouble inserting script

Don't use the HTML module for that. Add a Custom Footer module on your page and replace the XSLT box with this code:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">

<!--Add YOUR CODE HERE -->

</xsl:template>
</xsl:stylesheet>

You can just replace <!--Add YOU CODE HERE --> with your own script (the original script, not the one modified by HTML module).

Royster

 

08-22-2008 9:58 PM In reply to
jvolzer Joined on 06-11-2008 Posts 24
Re: Trouble inserting script

Okay, I'm making a little progress with that.  However, when I insert that code it causes the newsfeed that I'm trying to use it ends up getting rid of the template and taking over the whole page.  You can view it here:  http://www.calhouncycling.org/Newsfeed.aspx

08-22-2008 10:10 PM In reply to
royster Joined on 02-12-2008 Posts 1,478
Re: Trouble inserting script

Wrap a div container around your script:

<div style="width:500px;">

<script blah blah ...></script>

</div> 

Royster 

08-24-2008 8:09 PM In reply to
jvolzer Joined on 06-11-2008 Posts 24
Re: Trouble inserting script

More progress and almost there!  This seems to work find when viewed in Firefox, but it still causes the page to get replaced with just the script content when viewed in IE.  You can view the page here:  http://www.calhouncycling.org/hometest.aspx.  The script should appear at the bottom of the left column under "cycling news".  The custom footer I've inserted is:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">

<div style="width:300px;">
<script type="text/javascript" src="http://www.freshcontent.net/cycling_news_feed.php" defer="defer"></script>
</div>

</xsl:template>
</xsl:stylesheet>

 

08-24-2008 8:12 PM In reply to
jvolzer Joined on 06-11-2008 Posts 24
Re: Trouble inserting script

Oh, nevermind.  I forgot to remove the "defer="defer"" part that I copied over from earlier.  Withouth that it works fine in both browsers.  Thanks for the help!

 

08-24-2008 8:13 PM In reply to
royster Joined on 02-12-2008 Posts 1,478
Re: Trouble inserting script

Get rid of the defer tag:

<script type="text/javascript" src="http://www.freshcontent.net/cycling_news_feed.php"></script>

and try again

Royster 

Advertisement