/    Sign up×
Community /Pin to ProfileBookmark

Opening a link and adding text to the new link’s body

I am trying to open a new page where inside that page I would add certain text from the previous page. I have the following code but it does not add the information that I want it to add, it just opens a blank page.

<script type=”text/javascript”>

function getFilter(rangestart,rangeend){

var rstart=new Date(rangestart).valueOf();
var rend=new Date(rangeend).valueOf();
var coll=document.getElementsByTagName(“TD”);
var hidtable=document.createElement(“TABLE”);
hidtable.id=”hidResults”;

for(i=0;i<coll.length;i++){
if(coll[i].id.match(/^row(d+)date$/)){
rdate=new Date(coll[i].innerHTML).valueOf();
if(rdate>=rstart && rdate<=rend){
mytr=coll[i].parentNode.cloneNode(true);
hidtable.appendChild(mytr);

}
}
}

document.getElementById(“sub4”).appendChild(hidtable)

[COLOR=Blue]var pwin=window.navigate(‘test5.html’); [/COLOR]
pwin.document.open();
pwin.document.write(document.getElementById(“sub4”).innerHTML);
pwin.document.close();

}
</script>

.
.
.

<body>
<div class=”para” id=”sub4″ style=”display:none”>
test you can put your things in here

<br>

</div>

<div id=”newResults” style=”display:none”>
<table border=”1″>
<tr>
<td id=”row1id”>1</td><td id=”row1date”>05/01/2005</td>
</tr>
<tr>
<td id=”row2id”>2</td><td id=”row2date”>05/05/2005</td>
</tr>
<tr>
<td id=”row3id”>3</td><td id=”row3date”>04/05/2005</td>
</tr>
<tr>
<td id=”row4id”>4</td><td id=”row4date”>04/01/2004</td>
</tr>
<tr>
<td id=”row5id”>5</td><td id=”row5date”>04/05/2005</td>
</tr>
<tr>
<td id=”row6id”>6</td><td id=”row6date”>03/02/2005</td>
</tr><tr>
<td id=”row7id”>7</td><td id=”row7date”>10/05/2004</td>
</tr>
</table>

</div>
</body>

If above I use window.open(‘test.html’, ‘test’, config=’height=300,width=300′);
instead then it opens another window then it goes to the current page and over writes everything with the information that I am passing through rathen than writing it in the new link(test5.html). If I click ‘back’ then it goes to the correct page (test5.html) but it’s blank. I would rather not have it pop up a new window. Can someone help me out and tell me what I am doing wrong or if there is a better way to do this. Thanks…

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @redakasasha spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...