UK News Links
From All n One's bxp software Wixi
It can be useful to background research on a company for sales purposes. To this end bxp software can save a lot of time in research. The newspaper button links are simple JavaScript which reads the name of the company and then searches the relevant site for related articles. In this way you can scan a news paper for company related articles to further the background research of the company.
The first part is to put in a section header to hold the buttons. The following has three rows of buttons. The first are national news agencies.
<input type=button name=btnUKNewsTools1 id=btnUKNewsTools1 class='Master_Button' style='width:16%;' value='The Times' />
<input type=button name=btnUKNewsTools2 id=btnUKNewsTools2 class='Master_Button' style='width:16%;' value='The Telegraph' />
<input type=button name=btnUKNewsTools3 id=btnUKNewsTools3 class='Master_Button' style='width:16%;' value='The Daily Mail' />
<input type=button name=btnUKNewsTools4 id=btnUKNewsTools4 class='Master_Button' style='width:16%;' value='The Financial Times' />
<input type=button name=btnUKNewsTools5 id=btnUKNewsTools5 class='Master_Button' style='width:16%;' value='The Observer' />
<input type=button name=btnUKNewsTools6 id=btnUKNewsTools6 class='Master_Button' style='width:16%;' value='The Guardian' />So this adds the button, now we need to add some JavaScript to the onload of the page to add the functionality to the buttons. The first line looks up the field with the company name to do the searching on.
var strNewsKeyword = document.getElementById('strCDA_41_field_0_4').value;
//onLoad function to set up links if existing record
function fn_InitialiseUKNewsLinks() {
//If the values have been initialised
if (strNewsKeyword != '') {
//Add the onclick event to allow window.open
addEvent( document.getElementById('btnUKNewsTools1'), 'click', strURL_UK_TheTimes );
addEvent( document.getElementById('btnUKNewsTools2'), 'click', strURL_UK_TheTelegraph );
addEvent( document.getElementById('btnUKNewsTools3'), 'click', strURL_UK_TheDailyMail );
addEvent( document.getElementById('btnUKNewsTools4'), 'click', strURL_UK_TheFinancialTimes );
addEvent( document.getElementById('btnUKNewsTools5'), 'click', strURL_UK_TheObserver );
addEvent( document.getElementById('btnUKNewsTools6'), 'click', strURL_UK_TheGuardian );
}
}
//Daniels add event function
function addEvent( obj, type, fn ) {
if ( obj.attachEvent ) {
obj['e'+type+fn] = fn;
obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
obj.attachEvent( 'on'+type, obj[type+fn] );
} else
obj.addEventListener( type, fn, false );
}
//The News Sites
function strURL_UK_TheTimes(){
window.open("http://www.thetimes.co.uk/tto/public/sitesearch.do?querystring=" + strNewsKeyword + "&p=tto&pf=all&bl=on");
}
function strURL_UK_TheTelegraph(){
window.open("http://www.telegraph.co.uk/search/?queryText=" + strNewsKeyword + "");
}
function strURL_UK_TheDailyMail(){
window.open("http://www.dailymail.co.uk/home/search.html?sel=site&searchPhrase=" + strNewsKeyword + "");
}
function strURL_UK_TheFinancialTimes(){
window.open("http://search.ft.com/search?queryText=" + strNewsKeyword + "");
}
function strURL_UK_TheObserver(){
window.open("http://www.guardian.co.uk/search?q=" + strNewsKeyword + "§ion=theobserver");
}
function strURL_UK_TheGuardian(){
window.open("http://www.guardian.co.uk/search?q=" + strNewsKeyword + "§ion=");
}
//OnLoad fire it all off
fn_InitialiseUKNewsLinks();