Click to See Complete Forum and Search --> : function to call specific text added to array from text box


1christine
12-23-2003, 02:18 PM
Need to create array that stores text. Then need function to call choice of the previous text entry or next text entry. This is my code:
function link(){
var link = [];
for(i=0; i<link.length; i++)
parent.main.location.href=link[i];
}
This next part works, except for the last 2 buttons, as is. Once I have a working array I will change the onClick commands to access the array.
<INPUT TYPE="text" NAME="newUrl">
<INPUT TYPE="button" NAME="goto" VALUE=" Go To "
onClick="parent.main.location.href=document.controls.newURL.value">
<INPUT TYPE="button" NAME="next" VALUE=" Next URL "
onClick="parent.main.history.forward();">
<INPUT TYPE="button" NAME="previous" VALUE=" Previous URL "
onClick="parent.main.history.back();">

Thanks.

Khalid Ali
12-23-2003, 05:34 PM
can u be a bit more specific..am getting hard time understanding your actualquestion...u are using an array as well as you are using history object to go forward and beackwards

1christine
12-25-2003, 04:07 PM
What I need to do is create 2 frames. The parent will show a URL.
The second frame has a text box and three buttons: go to, previous and next. In the text box anyone can type the path or URL they want to show in the parent frame. The previous and next buttons don't work because of the security in IE that won't allow access thru the history or location properties to URL's that aren't on the same domain as the code.
I was trying to find a way around this. I thought if I could save each URL to an array and then have the previous and next buttons access the saved URL in the array it would work.

I don't completely understand how to use arrays although I'm getting better.

fredmv
12-25-2003, 05:15 PM
http://www.mozilla.org/projects/security/components/same-origin.html

Khalid Ali
12-26-2003, 07:19 AM
1. browser security structure dicates that a developer can not access any entries in the histiry object.

2. Out of domain resources will trigger browser to generate an "Access Denied" error when being attepmted to access that document.

The best you can probably do is use
history.go(-1) to go to previous entry in the history array and
history.go(1) to next entry in history array