chopper
04-25-2008, 09:28 AM
I have text that is displayed to a user on a website, the following javascript code then tells the system to take whatever is after two spaces in the text after "-" and display in an iframe, in this case it would be a http web address.
Once the address has been placed into an iframe I would like all text after the "-" to no longer be displayed to the end user, using some king of 'clear' function maybe?!
//////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)
{
document.getElementById("iframe").src = website;
//alert(Message);
}
Once the address has been placed into an iframe I would like all text after the "-" to no longer be displayed to the end user, using some king of 'clear' function maybe?!
//////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)
{
document.getElementById("iframe").src = website;
//alert(Message);
}