Keeping An Iframe From Loading Outside Its Source

Aug 6, 2003

I need some code that prevents the contents of an iframe from loading outside their source. Namely, the page has its main text content in an iframe so it can be scrolled through while keeping fixed size layouts. That iframe points to a file, content.html, that I want to keep the user from loading directly in the browser. I'd like it so, if they do go to content.html directly, it will just boot them back to the main index.

View 2 Replies


ADVERTISEMENT

Creating An Iframe In Function And Loading Source

Jun 22, 2011

I create an iframe in script and load it with this code.

[Code]...

This should force the loading of the savepages.php file. In that file I do an echo to verify that it is called.

[Code]...

The objective is to call that php function. The javascript function is called. I don't know if the element is actually created. Unlike php javascript doesn't put anything in the source for us to verify. I don't have ajax. How can I make the javascript function call create an element that loads the php file and causes the code in that php file to execute.

View 2 Replies View Related

Call Function After Iframe Source Completes Loading

Mar 8, 2009

I want to do exactly as mentioned on the title. You can consider this like surfing pages in traffic exchangers or PTCs. The functionality is exactly like those, though it is not for those.

This is what I have now.

Code HTML4Strict:

Currently, it shows "Page has been loaded" before even showing the "Please wait" part.

Secondly I changed the function to the following

Then it said info is null....

View 16 Replies View Related

Keeping Iframes From Loading

May 19, 2005

<pre>
<html>
<head>
<title>Snapitup Script</title>
<style type="text/css">
*{margin:0;padding:0;}
</style>
<script type="text/javascript">
/* script made by gmn17@hotmail.com &copy; 2005 free to use */
/* keep this script credit intact,thanx, a script to show/hide */
/* any html in IE Safari and Firefox, if you wish to preload */
/* just put it in the target, stripped out table and eval */
/* statements from 2 scripts and combined them, then altered */
/* part of a www.shawnolson.net script took eval statement out */
function snapitup(target,statement){
string = 'theTarget = document.getElementById("'+target+'");'
if(theTarget != null){
theTarget.innerHTML = statement;
}
var el=document.getElementById(target);
var theTarget=document.getElementById(target);
if(el.style.display!="none"){
el.style.display="none";
}else{
el.style.display="";
theTarget.innerHTML = statement;
}
}
/* use this to preload content */
function hideShow(target){
theTarget = 'document.getElementById("'+target+'");'
var el=document.getElementById(target);
var theTarget=document.getElementById(target);
if(el.style.display!="none"){
el.style.display="none";
}else{
el.style.display="";
}
}
</script>
</head>
<body>
<a href="#null" onclick="snapitup('row22','<iframe src=http://www.yahoo.com width=100% height=500px frameborder=none style=border:0></iframe>')">Category 1</a><br>
<a href="javascript:void(0);" onclick="hideShow(&#3933;')">Category 2</a><br>
<div id="33" width="100%" style="display:none;"><img src="tn_1_books.gif"></div>
<p id="row22" width="100%" style="display:none;"></p>
<a href="javascript:void(0);" onclick="snapitup('row11','<table id=nTable border=2 width=500 height=400 cellpadding=0 cellspacing=0><tr><td>Data One</td><td>Data Two</td><td>Data Three</td><td><a href=# class=button>More</a></td></tr></table>');">Category 3</a><br>
<div id="row11" width="100%" bgcolor="#b9b9b9" style="display:none;position:absolute;left:100px;top:100px;"></div>
</body>
</html>
</pre>

Ok first the bad, it will not work from a stylesheet, you have to use style="display:none" all over the place, I will try to fix that without adding more than 2 lines to the script somehow, I hope. you can not have line breaks in the innerHtml statements in your links(I think that's normal anyway). javascript:void(0); will not work for an iframe, you have to use #(or #null to keep from clicking up to the top of the page) for the hrefs, I don't know if that is a bad thing or not, there has to be something better than both of those options. now the good, if you do not have access to the head of a page, everything works from the body of a page. it is good for making ul/ol tags for a vertical menu without that complicated scripting having to differentiate ul/ol text and li links in those scripts for just a simple menu, the ecmascriptmenu is the only one that makes sense to me, hope he gets his server fixed. the script seems to work with or without a doctype in IE6 firefox and safari. people always wonder why I try to make these type of scripts, I usually maintain long lists of links so I like to provide small previews(iframes that do not load until clicked) for each link, the best part is that IE firefox and safari react to it flawlessly unlike most other types of scripting, one script had an eval statement that gave me tons of trouble taking it out and the other script I took out a server sql proprietary call to a rowid for a table and made almost any html element be a target(a p tag for instance).
here at :

View 9 Replies View Related

Iframe :: Each Browser Shows The Loading Icon, As If A Page Was Loading?

Mar 19, 2010

I have a lot of javascript functions that request information from an iframe hidden on the page. I see other sites do this, but their browser does not do the loading action (like the processing circle in Firefox). When I do it on my site, each browser shows the loading icon, as if a page was loading. Is it possible to not have this?

http://bit.ly/cv1YqN

That is a sample link. Go down right side of page where you see three buttons: Trailers Featurettes Clips.Those return iframe information to work.

View 4 Replies View Related

JQuery :: Dynamically Loading Source From A String Into The DOM

Aug 12, 2010

I'm experimenting with dynamic loading of javascript using JQuery. So basically I have a loadScript function that accepts either the URL of a JS file or a javascript source in a string. For the former, I create a 'script' element, set its src attribute to the URL of the file and insert the element into the DOM's head element. So far it seems to work nicely. For the latter, I create a 'script' element, set its innerHTML to the JS string and insert it into the DOM's head element. This doesn't work so well. I *think* it's because the JS source in question contains:

$(document).ready(function() {
// put all your jQuery goodness in here.
});

It looks like the JS source in my string is stomping over parts of the DOM it shouldn't and changing existing elements.

View 2 Replies View Related

Iframe Address Source

Apr 17, 2007

Is it possible to read the address of a page from another domain fully
loaded in an iframe, because when i call the page i ask to a cgi
script which returns an encoded url with a unic hashmac key i must
catch to create a temporary account with this key.

I tried many things but all what i got is the address i sent first.

View 1 Replies View Related

Put IFRAME Source Code Into Textarea

Jun 27, 2006

I would you grab the source code from an IFRAME and display it in a textarea?

I'm trying to create a sort of preview page that both shows a rendered page, then shows the source code next to it.

[edit]: I'm thinking that using OnLoad JS event in the HTML body tag would allow this to work. The page loads, the OnLoad event calls a JS function that pulls the innerHTML from the IFRAME and inserts it into the textarea.

View 4 Replies View Related

Sending Api Data To Iframe Source

Apr 19, 2011

Trying to append data from an API to the frame source; not loading. master page:

[Code]...

i'm kind of dizzy right now since i've tried X different versions...still working on it. the new URL doesnt load i want to get the stud_id from the API and append it to the url that i launch in the iframe

View 12 Replies View Related

Changing An IFrame Source From Input Text?

Aug 17, 2010

I am looking for an input text that links to a iframe. . ?

To begin, we need some simple HTML elements:

A basic form; An Input text that will contain the URLs we want to use; An iFrame that will display the page we select from the input text.

View 7 Replies View Related

Change Source Of Iframe After Page Has Loaded?

Feb 3, 2011

I have a single web page that loads several iframes. One of the iframe pages has to be logged in first. I have that taken care of but once the page is loaded I need to change the source to a link with in the page. My guess is I need something to execute the code like a onload or something. This is what Ive been trying to get to work but like I said a newb! code...

View 1 Replies View Related

IFRAME Source Swap - On Page Refresh

Nov 2, 2010

I am working on a module where I have 2 div tags which I wanted to swap on page refresh. i.e., when page loads it displays 1st div and upon refresh it loads 2nd div(and one more refresh wil load 1st and so on....). that works perfectly but the issue is I have an iframe inside both the divs which points to two different html files and its not swapping upon refresh. whatever iframe loads first remains there.

I thought its because of browser caching and the browser caches the iframe thats loaded 1st., so I tried adding meta tags on head like no-cache and expire=-1 but no luck.

View 3 Replies View Related

Changing IFrame Source From Main Window Onclick?

Nov 18, 2009

Ok, 'nother head-banger for the hardcore!

I have a "contact us" <a> with the id 'contact' on the main page, which is supposed to change the source file of an iframe to the contact page. Except when I click on "contact us" nothing happens.

I've tried to get this to work several different ways, and suspect that the problem is purely syntax, but I just haven't been able to figure it out.

Here's the code:

The snippet on the main page (index.html):

<div id="linkListContact" class="LinkList">
<img id="linkListContactBg" class="SideBarBgImg" src="Assets/Backgrounds/SideBar/ContactBg.png"></img>
<span>

[Code]....

The setIFrame function is used to call the content initially when the page loads, and is working beautifully in that context. You can see the problem in action at the actual site: [URL]

View 3 Replies View Related

Pulling Source Code Out Of IFrame & Saving As .txt File?

Mar 22, 2010

I am currently trying to script a way for the source code from a Rich Text Editor to be copied and saved as a .txt file in the same folder, when you hit the 'submit' button (see demo on link below).

The Text editor being used is [URL]

View 4 Replies View Related

JQuery :: Iframe Not Always Loading?

Aug 11, 2009

i have at the "three"button i've inserted an <iframe>..</iframe>, but it's loaded onlyonce, click on the "one", "two", "three" and again 1,2,3. what seemsto be the problem?i'm using jquery-1.2.6.js

View 1 Replies View Related

IFrame Close After Loading?

Sep 3, 2009

I am having real problems closing a iFrame after the document in the iFrame has been submitted. I using the prototype library and the following function works great to hide the window when clicking on a close button.

Code:

var docFrames = window.frames[0].document;
docFrames.getElementById('closeFrame').observe('click',function() {
$('frameshadow').hide()
$('photoFrame').hide()
});

The problem comes when I submit the form loaded in the iFrame. This function no longer works. I want to hide the iFrame after the form is submitted, but can't not figure out how.

View 1 Replies View Related

Loading Into An Iframe - Break Out?

Dec 23, 2011

I am using tinybox2 to make a modal window, which now I have loading correctly. the modal window loads as an iframe, but I have two image links inside the modal window. One I'd like to open in a new window (i got that one!), the other image I'd like to be treated the same as the X button and have it close the modal window.

this is the body onload in the main document <body onload="TINY.box.show({iframe:'modal.html',boxid:'frameless',width:750,height:450,fixed:false,maskid:'bluema sk',maskopacity:70,closejs:function(){closeJS()}})">
<script language="JavaScript1.2">mmLoadMenus();</script>

[Code].....

View 14 Replies View Related

Stop Iframe From Loading?

Mar 14, 2008

I got this page loading in an iframe, but after a certain time, I want it to stop loading. Meaning, I want to stop the page from loading. The page is in another domain. I don't how much else I can add, if someone needs some extra info

View 4 Replies View Related

JQuery :: Iframe Be Restyled After Loading?

Dec 20, 2011

I am loading an iframe with: $("#framename").attr("src", "uploadsource"); I was wondering if I could hide the framename div and restyle some things like background color and remove images, before making the div visible. I have tried using $(document).ready to reset the background color but the change doesn't take effect:$(document).ready(function() {$("#framename").css("background-color", "white"); }); There are some p tags that I would also like to restyle the font and color of before revealing the div. So, is there a way to change css attributes of an iframe after loading?

View 3 Replies View Related

Page Keeps Loading Once Iframe Removed?

Oct 30, 2009

i have the following

<script type="text/javascript">
$(document).ready(function () {
window.name = "main";[code]....

works perfectly but the main page keeps loading once the iframe is removed. Any know why and how i can terminate the loading?

View 8 Replies View Related

JQuery :: Can't See Source (with View Source) When Loads External Html Into A Div?

Feb 23, 2011

I got some code that loads divs from other web pages into a particular div in my main page. In other words, I click on a button, and this tells jquery to load afragment of a particular page into my main page. For instance if I have 5 web pages onrock stars, I could have 5 buttons, and each button could load one rockstar's biography into a div on the main page (and replace whatever was there before). This works, and I do see the content that it loaded. But when I do 'view source' in IE, I do not see that content (the bio of the rock star). Another clue that this content is not really there, is when I try and run some code on that content. The content (from those external pages) have divs with specific names, and I try and make them into collapsible panels by running the following short function:

var IdentifyPanels = function() {
$("DIV.ContainerPanel > DIV.collapsePanelHeader > DIV.ArrowExpand").toggle(
function() {

[code]....

View 2 Replies View Related

Can I Fire An Event When An IFrame Finishes Loading?

Jul 20, 2005

Can I fire an event in the host page when a contained IFrame finishes
loading? The page being loaded can come from anywhere (i.e. other sites),
and I need to know how long it takes to load.

View 1 Replies View Related

JQuery :: Loading A Page In An Iframe With BlockUI?

Jul 29, 2009

How would you load a separate page in an iframe with BlockUI? I tried: forceIframe:true, iframeSrc:'/iframepage.html' but BlockUI still creates the default "Please wait..." overlay, but also creates a seemingly separate iframe overlay, but without applying any of the CSS properties to it. If BlockUI doesn't have this functionality, so any of the other overlay plugins support it? I've tried jqModal and SimpleModal, but none of them seem to explicitly support this.

View 3 Replies View Related

Opening IFrame Link Loading Into Parent

Jul 22, 2011

I am having difficulty in opening a link in an Iframe. If I explain, I have four pages
-Page 1 containing the Iframe
-Page 2 containing a series of thumbnails that opens in Iframe on page 1
-Page 3 is the larger image that opens in the Iframe on page 1 after clicking the thumbnail on page 2
-Page 4 is a page with a linking menu that has a link to page 3

The task I am struggling with is to get the link on page 4 to open the larger image of page 3 in the Iframe on page 1. Now I maybe doing something wrong but the code is opening page 2 in the Iframe on page 1. Below are the links to the pages in question.
Page 1 Art for Sale - Bertram Enterprises
Page 2 Bertram Enterprises Collection_Ver2
Page 3 [URL]
Page 4 Jenni Dutton - Bertram Enterprises link near bottom of page - Art for Sale
I wish to use this on many more of the images.

View 7 Replies View Related

Knowing When An IFRAME Has Finishing Loading A Page?

Jul 14, 2010

is the .wait function/property/attribute relevant?Basically I have a system to test for final loading but it relies on links.length (or "TD" etc)and is not fool-proof.What attribute should I be looking at to see completion of loading?

View 9 Replies View Related

Iframe :: Loading Page With Script Alerts?

Nov 25, 2010

i am loading a page into an iframe...

Code:
<iframe src="http://www.cult.co.uk/men/shop/hoods-and-sweats/details/25705/75-wings-foil-hood" width="500" height="500" id="iframeTest"/>
the page from cult.co.uk has javascript alert() messages embedded in the code, which are triggered when the page loads via the iframe.is there a way of suppressing the alert() messages?I know i can suppress alerts on my local site by adding the following function:

Code:
function alert(){};

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved