Closed Thread Icon

Topic awaiting preservation: QUICK JS syntax question (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=7967" title="Pages that link to Topic awaiting preservation: QUICK JS syntax question (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: QUICK JS syntax question <span class="small">(Page 1 of 1)</span>\

 
Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

posted posted 12-05-2001 16:30

I need this by the end of class.. >_<
ie. 45 minutes from now

how do i link to another page from js?
such as..

you click, it runs a function, then it 'goes to another page'.. i'm unfortunately stumped.

function img(new_img,title,artist,link,comment){
if(!srhsImage){
if(document.all){
var srhsImage = window.open('../images/index.html','srhs_images','width=200,height=200');
}else{
this.location = new_img;
}
}

thats what i wrote for now.. i dont care about errors right now, but i cant even get it to go.


» THOAN.net (..soon to come..I hope)

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 12-05-2001 17:11

Don't know if this is what your looking for but...

[code]
<script>
<!--Hide script from bad browsers

function go(newLoc){
newPage = newLoc.options[newLoc.selectedIndex].value

if (newPage !=""){
window.location.href=newPage
}
}
//End Hiding script-->

</script>
[code]

Then call it like:
go(this.form.newLocation) <!--This can be used in the value of a combo box-->

Such as <form>
<select onchange="go(this.form.newLocation)">
<option value="myPage.html"><!--will refer to the page set by the value-->
</select>
</form>

~hope that helps~

C:\

Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

posted posted 12-07-2001 06:58

thanks, that did the trick. =) I'll post up th results in the site review section later


» THOAN.net (..soon to come..I hope)

Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

posted posted 12-15-2001 01:25

heh.. what a biznotch. After a lot of modification, the code was working beatifully, with a few annoyances from netscape that ended up being compensated for, and then when we uploaded it to the linux box, it didn't work. XD Oh well. I can't work on it until we get back in school. Yay, fun.

Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

posted posted 12-19-2001 15:36

Okay, I've got an entire day to get this code working - or at least until 2:50. (~6 hours from now) [here's the zip file]

I've included all the necessary files.
The problem is in the image code... And Once I get this working I may start on a dHTML part that makes the window animate and a bunch of other fancy stuff like that, but I think it would be wise to get this working first right?

Thanks to anyone who can help. =)

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 12-19-2001 15:44

Glad that it worked. By the way, AngelFire won't allow linking from another page. Couldn't get the zip file.

Later,
C:\

Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

posted posted 12-19-2001 15:47

um.. so go to the page, and then redirect yourself to the url?
Its accessable, it just takes a bit of effort..
http://www.angelfire.com/biz5/groovz/FAPA.zip

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 12-19-2001 18:47

Replace this in "imageCode.js":

srhsImage.document.object.viewedTxt.innerHTML = text;

With this:

srhsImage.document.all["viewedTxt"].innerHTML = text;

Replace this in "images/index.html":

<div name="viewedTxt">

With this:

<div id="viewedTxt">


Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

posted posted 12-20-2001 01:10

Ah, that would make a lot more sense. ^_^;
Also, is there a way I can do this same code effect for netscape? Last time I tried it in there, it didn't work at all; hence I have it so that the page simply redirects in such a case.
*fixes code* Thankyou Max.

Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

posted posted 12-22-2001 02:16

For anyone who wants this file, i moved it to www.angelfire.com/biz5/groovz/download/ =)


-Bmud-

« BackwardsOnwards »

Show Forum Drop Down Menu