It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

a simple iframe manipulation

a simple iframe manipulation

Postby 13r1i14 on Tue Nov 07, 2006 8:15 am

hi,

i have a page with an iframe in it, and i have a java script that change the src of the iframe.
It all works perfectly fine when i set the source to an HTML page, but if i set it to a PHP page, instead of changing the iframe source, a prompt window appears asking if i want to open or save the page. if i chose open, it opens as text (code).

here is the simple code:

the function that changes the frame:

Code: Select all
function ChangePage(page_src)
    {
          frames['f1'].location.href = page_src
    }


here is how i call it:

Code: Select all
<img src="images/img.gif" style="cursor: hand" onclick="ChangePage('test.php')">


i will appreciate the help. thanks
13r1i14
 
Posts: 2
Joined: Tue Nov 07, 2006 7:51 am

Postby mwa103 on Tue Nov 07, 2006 8:09 pm

Can you open test.php separately without using the JavaScript and iframe or does it give you the same error?
mwa103
100+ Club
 
Posts: 206
Joined: Mon Mar 07, 2005 10:55 pm

Postby 13r1i14 on Wed Nov 08, 2006 5:44 am

mwa103 wrote:Can you open test.php separately without using the JavaScript and iframe or does it give you the same error?


yes it works fine.
13r1i14
 
Posts: 2
Joined: Tue Nov 07, 2006 7:51 am


Who is online

Users browsing this forum: No registered users and 4 guests