officemanager2
Technical User
I've managed to put the follow together using posting boards and when loaded on a dreamweaver page it seems to work fine:
In this version everything works fine. Click 'send this..' and it does everything as anticipated. The problem is when I use this same code (changing the ID for different sections) on a site the last paragraph will not work. Oddly enough if the section has four paragraphs the first three will work, but not the forth. Same issue with five paragraphs. To add to the headache, if there are four paragraphs I can only link to three of them because adding the fourth ID causes the link to disappear all together.
If the section only has two paragraphs this does not seem to be an issue. Is this tied into !=-1 ??
I've just started with javascript about two weeks ago so lots of mystery's.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<tr>
<td class="bookman" valign="top">
<p id="sst">test page</p><a name="light" id="light"></a>
<td class="text">
<p align="justify" id="ss1">Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p>
<p align="justify" id="ss2">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p>
<p align="justify" id="ss3">Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
</td>
</tr>
<tr>
<td ><p align="left"> <a href="#">Top of page</a>
</p></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! [URL unfurl="true"]http://javascript.internet.com[/URL] -->
<!-- Original: David Henry (davidputhenry@hotmail.com) -->
<!-- Web Site: [URL unfurl="true"]http://www.davidphenry.com/[/URL] -->
<!-- Begin
function isPPC() {
if (navigator.appVersion.indexOf("PPC") != -1) return true;
else return false;
}
if(isPPC()) {
document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?subject\= ' + document.getElementById('sst').innerHTML + document.getElementById('ss1').innerHTML + document.getElementById('ss2').innerHTML + document.getElementById('ss3').innerHTML + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send this section to a freind">this section<\/A> to a friend</b>');
}
else { document.write('<b>Send <A CLASS="contact" HREF=\"mailto:?subject=Trying to load paragraphs from page to email\&body\= ' + "%0A" + document.getElementById('sst').innerHTML + "%0A" + "%0A" + document.getElementById('ss1').innerHTML + "%0A" + document.getElementById('ss2').innerHTML + "%0A" + document.getElementById('ss3').innerHTML + "%0A" + "To view the entire site use the link below" + "%0A" + "%0A" + "[URL unfurl="true"]http://www.somesite.ca"[/URL] +'\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send this section to a freind">this section<\/A> to a friend</b>');
}
// End -->
</script>
</body>
</html>
In this version everything works fine. Click 'send this..' and it does everything as anticipated. The problem is when I use this same code (changing the ID for different sections) on a site the last paragraph will not work. Oddly enough if the section has four paragraphs the first three will work, but not the forth. Same issue with five paragraphs. To add to the headache, if there are four paragraphs I can only link to three of them because adding the fourth ID causes the link to disappear all together.
If the section only has two paragraphs this does not seem to be an issue. Is this tied into !=-1 ??
I've just started with javascript about two weeks ago so lots of mystery's.