Forum Moderators: open
1. document.write('<p>something</p>');
2. document.write('<p>something else</p>');
3. document.write('<p>something entirely different</p>');
etc...
<script language="javascript" src="myscript.js#3">
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled</title>
<script type="text/javascript">
var phrases = [
'<p>something</p>',
'<p>something else</p>',
'<p>something entirely different</p>'
];
</script>
</head>
<body>
<p> bla blah blah<strong>
<script type="text/javascript">document.write(phrases[1]);</script>
</strong>more blah blah blah.
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled</title>
<script type="text/javascript">
var phrases = [
"document.write('<p>something</p>')",
"document.write('<p>something else</p>')",
"document.write('<p>something entirely different</p>')"
];
</script>
</head>
<body>
<p> bla blah blah<strong>
<script type="text/javascript">eval(phrases[1]);</script>
</strong>more blah blah blah.
</body>
</html>
var line=/\?(?:.*&)*line=(\d)+/.exec(document.location),
req=window.XMLHttpRequest?
new XMLHttpRequest():
new ActiveXObject('Microsoft.XMLHTTP');
line=+line[1];
req.onreadystatechange=function() {
if(this.readyState==4) {
this.status==200?
eval(this.responseText.split(/\r?\n/)[line]):
alert('error');
}
};
req.open('GET','myscript.js',true);
req.send();