Jump to content

Very tiny iframe problem

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
9 replies to this topic

#1
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
Hi all
im using javascript to change the "src" attribute of an iframe

function change(){

frameid.Src= somepage.Htm

}

the src is changed but the iframe doesnt show the new htm page and i cant find a method to refresh or navigate the iframe
im going crazy here, can you help me?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I would have this in a form that targets the iFrame for opening. That would let you activate submit() in the javascript to reload the iFrame.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
Thnx for replying
I did what you said
when i change the src and activate the submit() the src is reset to the initial value not the new one, i tried to remove the src from the iframe tag but it displayed a blank page even after the submit()

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Can you post your code?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
sure here it is:


<html >

<head>

    <title>main</title>

    <script  type="text/javascript" >

function changesrc(){

                             frr.src ="a.wrl"

                             frm1.submit ()

                            }

</script>

</head>

<body background=" " bgcolor="silver" >

<form  id =frm1>

    <table align=center >

    <iframe   id =frr align=top title ="vrml testing"  width=800 height =600 style="text-align: center"></iframe>

    <br />

   </form>   

    <input   type =button onclick ="changesrc()"  value ="load next object"  size=20/>      

</body>

</html>


yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#6
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
the a.wrl is a text file but the frame shows nothing
when i make the src="a.wrl" in the ifarame tag it shows up normally
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#7
shibbythestoner

shibbythestoner

    Programmer

  • Members
  • PipPipPipPip
  • 135 posts
This seems to work in my versions of FF and IE:
<html >
<head>
    <title>main</title>
    <script  type="text/javascript" >
function changesrc(){
                             document.getElementById("frr").src="a.txt"
                             return(false);
                            }
</script>
</head>
<body background=" " bgcolor="silver" >
<form  id =frm1>
    <table align=center >
    <iframe   id =frr align=top title ="vrml testing"  width=800 height =600 style="text-align: center"></iframe>
    <br />
   </form>   
    <input   type =button onclick ="return changesrc()"  value ="load next object"  size=20/>      
</body>
</html>
Hope that helps.
Posted Image

#8
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
try working with the solutions presented here.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#9
shibbythestoner

shibbythestoner

    Programmer

  • Members
  • PipPipPipPip
  • 135 posts
Oh and by the way, I renamed the text file so you'll need to modify the code slightly.
Posted Image

#10
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
Thnx alot all the above solutions worked