I am trying to set up on iframe on a SharePoint 2007 page that will show the most current project report uploaded to a document library. Here is my code, inserted into the page in the source of a Content Editor Web Part. I will explain how it works below
<script type="text/javascript" language="javascript">
function CurrentReport()
{
var link = $(".ms-vb-icon:first a").attr("href");
return "https://intra.sse.gov.on.ca" + link;
}
$(document).ready(function(){
$("#EPMReport").attr("src",CurrentReport());
});
</script>
<iframe class="EPMReport" id="EPMReport" height="605" width="795" src=""/>
The way it works is that the page has a list view web part of the document library on it sorted by date to get the newest at the top. The CurrentReport function searchs through the page to find and return the link to the first item of the document library. Then the iframe src is set by calling the function CurrentReport(). Everything works and the current report is shown in the iframe but there is two errors on the page caused. Error message for both is
Message: Object expected
Line: 483
Char: 2
Code: 0
Both errors say the same thing and I can't find any code on line 483 would be causing the problem.
In the Content Editor web part I have tried putting the iframe code above the javascript and it then doesn't work at all, no report is shown. Any ideas would be great. Thanks in advance for any help.