Charly
03-07-2013, 03:23 PM
1) Script Title: gfeedfetcher.js
2) Script URL (on DD): http://elot.ca/classify/newsfeed.php
3) Describe problem: I have wrapped the script contents inside a function, it is activated with a button, It works in Google Chrome but not in Firefox 19.0
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
<script type="text/javascript" src="gfeedfetcher.js">
/***********************************************
* gAjax RSS Feeds Displayer- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script type="text/javascript">
function loadfeeds()
{
var newsfeed=new gfeedfetcher("ample", "ampleclass", "_new")
newsfeed.addFeed("BBC", "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml")
newsfeed.displayoptions("label datetime snippet") //show the specified additional fields
newsfeed.definetemplate("<div style ='width: 410px; height:120px; padding: 4px; border: 1px solid sienna; float:left;'>{title}<br /><div style= 'color:brown; font-size: 90%; float:left; padding-right: 4px;'>{label} </div><div style='color:gray; font-size: 90%; float:left;'> {date}</div><br />{description}</div>")
newsfeed.setentrycontainer("p") //Display each entry as a p
newsfeed.filterfeed(40, "date") //Show 40 entries, sort by date
newsfeed.init() //Always call this last
}
</script>
</head>
<body>
<button type="button" onclick = loadfeeds()>Load feeds</button>
</body>
</html>
2) Script URL (on DD): http://elot.ca/classify/newsfeed.php
3) Describe problem: I have wrapped the script contents inside a function, it is activated with a button, It works in Google Chrome but not in Firefox 19.0
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
<script type="text/javascript" src="gfeedfetcher.js">
/***********************************************
* gAjax RSS Feeds Displayer- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script type="text/javascript">
function loadfeeds()
{
var newsfeed=new gfeedfetcher("ample", "ampleclass", "_new")
newsfeed.addFeed("BBC", "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml")
newsfeed.displayoptions("label datetime snippet") //show the specified additional fields
newsfeed.definetemplate("<div style ='width: 410px; height:120px; padding: 4px; border: 1px solid sienna; float:left;'>{title}<br /><div style= 'color:brown; font-size: 90%; float:left; padding-right: 4px;'>{label} </div><div style='color:gray; font-size: 90%; float:left;'> {date}</div><br />{description}</div>")
newsfeed.setentrycontainer("p") //Display each entry as a p
newsfeed.filterfeed(40, "date") //Show 40 entries, sort by date
newsfeed.init() //Always call this last
}
</script>
</head>
<body>
<button type="button" onclick = loadfeeds()>Load feeds</button>
</body>
</html>