Is there a way to change an iframe's src with a javascript? I need to have an iframe on my webpage display different data based on which link is clicked. I don't want to have it reload the whole page, just the iframe.
I need solution to change the url but not the page.
I need something like whan going to a site, the url changes to whatever, but there is no page count, so I just get the new (right) address, but when going back I go back to the page I came from. Secondly I dont want a back-trap.
Why?
Say someone opens www.mysite.com, end is gives index.php to the clinet - which enters a password and the browser offers to save that - later, when logged out, the client is sent to www.mysite.com/index.php, and the browser offers to save that password too... for another url, but still the same page...
Here's the thing, I'm using the iframe as a "browser" within the page on top of the iFrame I've got an input box that I want to use as the address bar
so I did some reading and I can see it's not possible due to security issues, because they're different domains.
but maybe there's a way to get the URL through server side, an xmlhttprequest perhaps?
the only person that's ever going to use this is me, and only on my home PC maybe there's a way to change the browser security settings to make this work? (running Firefox 1.5)
here's the code I'm using that's obviously not working
Code:
var url=document.getElementById('preview').src; document.getElementById('addressBar').value=url;
I have a page with an iframe. On the main page I have a form. Now I want this form to on submit, execute something on the iframe (refresh). However I have different can have different iframe pages. What I need is a way figure out the name or file name of the page inside the iframe and then refresh that page. So it looks something like this:
I want to know the recommended way to handle scripting of/with containers such as an iframe. I have a page with border-navigation bars on the top/bottom/left/right and I want to use an iframe to load content in the middle.
I would like, if possible, to have the parent window resize itself to suit whatever is loaded into the iframe container, deriving the size needed from calculated values. Thus the calculation would have to over-ride default and/or previous settings for the size of the initial iframe after all of the associated container content has been fully loaded and rendered....
I have a web application interacted with through my site via an iframe. The web app displays maps and other info. When i try to load it in the iframe to view the map i get this javascript error: "'parent.mapframe' is null or not an object"
Is this because it is seeing the iframe as the parent frame? Is there anything i can do to get round this?
How do you turn an iframe scrollbar off, from within javascript, after the iframe has been loaded? In my example, the page with the iframe on it is initially set to scrolling=yes, however, I want to be able to set the scrollbar=no, through javascript.
Is there some way from preventing the JavaScript code in a document loaded into an iframe from executing? I don't have access to the pages being loaded into the i-frame so I can't modify then. They are being loaded from a server.
What I get in IE is the "YO!" written to the iframe. What I get in Firefox is the 404 not found page of the site where the original "jstest.html" page and script are hosted.
I have a page with an iframe. The page defines some JavaScript functions in the head part. How can I access these functions from the iframe? In Firefox I can use parent.myFunction() but it doesn't work in IE.
Okay, so I've just installed a javascript that redirects to any random page from a specified list. The problem with it is, it's in an iframe and works as sort of an advertising area. So on the mainpage where the iframe has been placed, whenever someone uses the back button, it just keep going back in the iframe and choosing random pages. The back button doesn't work on the mainpage and instead is used in the actual iframe.
I'm not sure if this is a problem with the iframe or the script, and I don't think I have the mental capacity to figure it out so I'd really value some help! Oh, and apparently the problem doesn't occur when using Firefox. Code:
I have an IFrame whose document is created completely by Javascript code at runtime. The document in the IFrame accesses Javascript functions in the top level document. This works fine most of the time. But every now and then, when I hit the back button, the browser suddenly thinks the Javascript created document in the IFrame is not from the same domain as the topmost document, and therefore I start getting "permission denied" errors when I try to access the top level document's Javascript functions.
If I look at the IFrame document's properties (Mozilla->This Frame->View Info), it shows the expected URL with a domain name that matches the top level document.
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems.
my script is based on ajax-uploader, which can be found at www.srmiles.com/freestuff/ajax_file_uploader/ . you can do multiple file uploads. each upload will have it's own "form"-tag, so that each file is uploaded for its own. could be a good solution if there are "big" uploads.
so here is what i do:
i have a html-page in which several forms with file-input fields are generated. when i now hit the "one" submit button at the bottom of the page a javascript function upload() starts it will iterate through all forms (id='frmUpload_xx'), will get the filename, start a ajax request for the progress-bar function and do a form.submit().
if the first form/file is uploaded, a settimeout('upload()', 1000); is called and the next form will be processed. all form's have an target="uploaddiv", where uploaddiv is a invisible iframe. so the output of the upload script is put in this div. output should only be a "OK" at the end. no usefull output no info no nothing.
firefox and safari are working as expected, only IE stops after the first file is uploaded. i get an javascript error saying "zugriff verweigert/access denied" on object line x... this is the place where i call "form.submit()".
this is the upload-function:
function upload() { if (uploads.length>0) { form = document.getElementById('frmUpload_'+uploads[0]); if (form["filename"].value == ""){ alert("Please Choose a file to upload."); } else { filename = form["filename"].value; if (filename.lastIndexOf("")>0) { filename = filename.substring(filename.lastIndexOf("") +1,filename.length); } else if (filename.lastIndexOf("/")>0) { filename = filename.substring(filename.lastIndexOf("/") +1,filename.length); } makeRequest("upload_progress.php?sid="+sid +"&filename="+filename,progress); form.submit(); } } }
the strange thing is, that filename is filled correct, that means the object "form" is found and exisits. the first iteration is working, only the second ends with an error.
think it have something to do with redirecting the output of the upload-script in an iframe. after that IE can't access form - at least IE is not allowed to submit the form as i can access a form field (filename). i worked on that the last two days and haven't found a solution...
I'd like to resize an iframe into which different (same domain) pages of differing heights are loaded. I can do a first-time resize no problem. It's the subsequent reloads that need to pass back their height to the parent page There seem to be lots of solutions for that around, but few I can see for resizing each time the iframe reloads. One is described here on another board [URL] but unfortunately the test page is no longer around (or indeed the site), so the full code is no longer available there. This one works, almost, for me: [URL] it does resize for me, but not quite sufficiently high each time - about 90% of what is required: [URL] Is there a way to add on sufficient extra margin that scrollbars no longer appear?
Is there a way to resize an iframe dynamically so that you never get the scroll bar and essentially hide that there is an iframe? Better integration really.Basically I want to iframe a forum into my site so that the design down the sides and top which my friend does using iweb are not messed with.We have a central area which can be longer or shorter depending on the forum.
I have a page A and inside it I have an iframe B. B points to another php file that shows a form (so basically in the iframe we see a form). When I submit the form, I call to another page C that verifies the fields of the form and if they are ok I redirect to page X, if not I redirect to page Y. The problem is that I see page X and Y inside the iframe, and I want to see them in the parent page.