Click to See Complete Forum and Search --> : Frame Problem


Jupac
08-09-2003, 04:27 PM
HI my page is in a frame and i want the top frame to say where are you at so i did this

This is in the top frame
<script>
var page="main.page.value";
document.write("<font color=red>"+page+"</font>")
</script>


This is in the main frame
<script>
var page="Home";
</script>
but all it said is main.page.value

AdamBrill
08-09-2003, 05:06 PM
This:

<script>
var page="main.page.value";
document.write("<font color=red>"+page+"</font>")
</script>

Should be this:

<script type="text/javascript">
var page=main.page.value;
document.write("<font color=red>"+page+"</font>");
</script>

I hope that helps. :)

Jupac
08-09-2003, 09:19 PM
Hi adam it dosnt work it only works with out frames

AdamBrill
08-09-2003, 09:47 PM
Ok... This is a stab in the dark, but try this:

<script type="text/javascript">
var page=parent.main.page;
document.write("<font color=red>"+page+"</font>");
</script>

That is assuming that main is your frame name and page is the variable... Otherwise you could use this:

<script type="text/javascript">
var page=parent.page.document.location;
document.write("<font color=red>"+page+"</font>");
</script>

Which will get the actual location...

Jupac
08-10-2003, 09:43 PM
Originally posted by AdamBrill
Ok... This is a stab in the dark, but try this:



That is assuming that main is your frame name and page is the variable... Otherwise you could use this:



wow that exacly what i needed you must be good at stabing in the dark
:) :D :cool: :p ;) :rolleyes: :eek: :')

AdamBrill
08-10-2003, 09:45 PM
Good, lol. After I looked at it again, it wasn't as much of a stab in the dark as I first thought. :p

:D

Jupac
08-10-2003, 10:07 PM
ooops i spoke too soon it dosent chage when the parent window chage so i tried

<script type="text/javascript">
var page=parent.main.page;
var page2=parent.main.onchange=page;
document.write("<font color=red>"+page2+"</font>");
</script>
but it dose nothing!!!


:eek: :eek: :eek: :eek: :eek: :'(

AdamBrill
08-10-2003, 10:10 PM
Well, for that you have to put that code into a function and run the function whenever the page refreshes... Know what I mean?

Jupac
08-11-2003, 06:08 PM
Well i just wrote something and i think it dose the same thing

<script type="text/javascript">
function name(){
var pname=parent.main.page;
if(parent.main.loaction.change){pname;
}
else{
document.write(""+pname+"")
}

</script>
<script>
document.write(""+name()+"")
</script>

i dont no i i thing "+pname+" & "+name()"+ is the same thing i dont think you can do this "+name()+"
LOL :'}

Jupac
08-11-2003, 06:10 PM
Well i just wrote something and i think it dose the same thing

<script type="text/javascript">
function name(){
var pname=parent.main.page;
if(parent.main.loaction.change){pname;
}
else{
document.write(""+pname+"")
}

</script>
<script>
document.write(""+name()+"")
</script>

i dont no i i thing "+pname+" & "+name()"+ is the same thing i dont think you can do this "+name()+"
LOL :'}
i must be :')