Heres the code, its part of a sndReq() Function, when user presses button
var Message = 'Initial Value'; // Declare var
if ( xmlDocumentElement.firstChild == null )
{
Message = "Can you re-phrase that question please";
}else{
Message = xmlDocumentElement.firstChild.data;
}
//////Website Parsing
var the_url = Message; //prompt("What's the URL?","");
//assign the chararter position of the symbol to 'dash'
var dash = the_url.indexOf("-");
//alert(dash);
//get character position 2 characters after the dash variable
var domain_start = dash + 2;
///get everything after the character poistion domain_start and set to variable website
var website = the_url.substring(domain_start, the_url.length);
//if dash is equal to or more than 19 charcater position
//then put the website variable in the iframe.
if (dash >= 19)
{
window.open(website,'','scrollbar=no,height=500,width=400');
//alert(Message);
}
Bookmarks