Communicate Between Iframes On Different Subdomains

Nov 17, 2006

Is there a way to communicate between iframes on different subdomains?
e.g. from one.dot.com to two.dot.com? there is a security access
restriction passing javascript commands between subdomains that we've
run into.

View 8 Replies


ADVERTISEMENT

Setting Cookies Across Subdomains Or Paths

Jul 23, 2005

I am setting a cookie on a subdomain:
http://store1.mydomain.com

Then the store takes me to a shopping cart that is at:
http://shopping.mydomain.com

Somewhere the following code (taken and modified from The JavaScript Source)
is broken between domains, because when I click my "store" link that should
read the cookie and send me to store1.mydomain.com or storeN.mydomain.com I
get the default template store.

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore -->
<!-- Web Site: The JavaScript Source -->

<!-- Begin
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

var favorite = GetCookie('store');

if (favorite != null) {
switch (favorite) {
case 'store1' : url = 'http://store1.mydomain.com/'
break;
case 'store2' : url = 'http://store2.mydomain.com/'
break;
case 'store3' : url ='http://store3.mydomain.com/'
break;
case 'storeN' : url = 'http://storeN.mydomain.com/'
break;
}
window.location.href = url;
}
// End -->
</script>
</HEAD>

The cookie is set by a javascript "onload command" Like I said I have it
working on a server with no sub domain.

View 1 Replies View Related

Include An External File Across Subdomains?

Jun 23, 2011

I've got a situation where an already existing include file (included in various clasic .asp pages) needs to have some javascript embeded in it to detect if the user is on http: or https: This include file is used in the main domain, as well as sub domains. The "gist" of what I'm trying to do is this: header.inc (the include file included by many .asp files) used by [URL] as well as [URL], [URL], etc.

<script type="text/javascript">
if (location.protocol != "https:") {
<!-- include virtual="/SSI/some_other_include_file.inc -->
}
</script>

Obviously, that doesn't work, but needs to have something like the include virtual because of the usage across subdomains. Basically, if the user is NOT on the secure protocol, I want to include that other file, regardless if they are on the main domain, or any of the sub domains. I've tried:

[Coe]...

View 2 Replies View Related

How Do I Communicate Between Frames In A Web Browser?

Aug 20, 2006

To reference another frame, you simply need to step through the
frame hierarchy: `` parent '' is the page the frame is defined
in, `` parent.framename '' is another frame in the same frameset.
To access a variable called Moomin in a frame called Snork you
would use `` parent.Snork.Moomin ''. To call the function Snufkin
in that frame you would use `` parent.Snork.Snufkin() ''....

View 2 Replies View Related

JQuery :: Use It To Communicate With Database ?

Dec 11, 2011

How can i use Jquery to communicate With database ?

my case is:

I use database Sql , i have j query grid view ,inputs text for First name,last Name ,and button submit

What i want Is:

When page loaded : Gridview loaded with user data[from database]

when user Filled inputs text and press submit :all user data saved in my db[sql] then reload gridview with user data.

is that any way to do that ?

View 1 Replies View Related

Possible To Communicate With Udp Protocol In Script?

Apr 22, 2011

Is there any possibility to communicate with udp protocol in javascript.

View 4 Replies View Related

Ajax Communicate With Seperate Webpage

Feb 8, 2006

How can I use XMLHttpRequest communicate from webpage to another? Currently I have a left/right frames, when the submit button pressed (item is added to the database), the left frame should automatically retrieve this item and display it on the page.

I thought of using Ajax (XMLHttpRequest object), but not sure how to use XMLHttpRequest object in two different webpages.

View 1 Replies View Related

Creating Object To Communicate With Flash

Jul 1, 2009

I have a Flash movie on a web page and I want to send parameters to it with JavaScript to have it go to a selected frame. The AS3 code receives its information via an ExternalInterface API. The following code parses the URL argument (?page=x) and I want to send the value (x) to Flash. Unfortunately, when creating the objMovie variable, it is always undefined, therefore getFlashMovie is undefined and Flash never receives the callback. Thinking that it was because the flash movie is not loaded yet, I created a button to call callToActionscript, and when I click the button, I get the same error.
(getFlashMovie("myFlashMovie") is undefined)

Also,
if (params)
always returns true, whether there are parameters or not. I don't understand that, either.

The code follows:
<script >
$(document).ready(function() {
var params=getQueryParameters();
if(params) {
callToActionscript(params[0]);
}});
function getFlashMovie(movieName) {
var isIE = navigator.appName.indexOf("Microsoft") != -1;
var objMovie = (isIE) ? window[movieName] : document[movieName];
alert(objMovie); //Always return undefined
return objMovie;
} function callToActionscript(page) {
var myMovie=getFlashMovie("myFlashMovie").sentToActionscript(page);
} function getQueryParameters() {
var query = window.location.href.split('?')[1];
//query won't be set if ? isn't in the URL
if(!query) {
return { };
} else{
var param = query.split('=');
} return param[1];
}
</script>

View 1 Replies View Related

Communicate To Child Iframe From Main Page

Apr 22, 2009

I'm trying to access a child iframe from my parent page. Is it possible? I've googled this extensively ut have found only scripts that allow me to communicate from the child iframe to the parent iframe. I want to do it the other way round. I need to be able to get in to the child frame and access it's DOM.

View 8 Replies View Related

Validation - Simple Html/php Form To Communicate With Twitter

Feb 18, 2010

Im using a simple html/php form to communicate with twitter, im trying to add some java script validation but it isnt working i cant see why it isnt.

This is my code.

<?php

Javascript Form validiation:

View 1 Replies View Related

Assigning Functions (play A Video Playlist By Passing It A Playlist ID) To Url Subdomains

Aug 15, 2011

I am creating a website, and I have javascript function that will play a video playlist by passing it a playlist ID. I want to be able to share a url that points to my website and also calls a javascript function, like: [URL] If someone clicks/enters that url, they redirect to my website and the getPlaylist(id) function is called. Is there a way I can do this?

View 1 Replies View Related

Communicate Between Pop Up Window And The Parent Window?

Jan 24, 2011

I have a web site. The user input is a record id. When the form is submitted, the cgi code will check if the id is in the data base, if its in the database, it will be processed, and results being displayed. If the id is not in the database, I need to pop up a window telling the user the next available id, and when the user closes the popup window, the browser should go back to the first form submit page, with the next available id in the input box.

Right now, I can pop up an alert window telling the next available id, but have no idea how to go back to the submit page when I close the alert window.

View 2 Replies View Related

Using Frames / Iframes

Sep 12, 2005

I believe that different browsers treat frames/iframes differently, and this
is one of the reasons to avoid using them in websites/applications.

Are there any other reasons to avoid them?

In my experience I find them clunky and messy to implement using javascript
and prefer to keep the whole web page as a single page.

View 1 Replies View Related

Multiple Iframes

Aug 29, 2006

Code:

Currently, I have one of the iframes working. When you click on it text
below appears with information about the jewelry.

I would like an iframe to open up (immediately to the left of the
image) and show an enlarged image of the thumbnail (yes I know right
now the images are not thumbnails, but my friends are working on the
graphics).

View 1 Replies View Related

Javascript & Iframes

Jul 20, 2005

I want to load a javascript file on a root page with various iframes,
then call the javascript functions from the root page to be displayed
in the iframes. Any idea how to do this?

View 2 Replies View Related

Function On Iframes

Aug 8, 2007

I have a mainpage and it contains iframe (myFrame). A js function validatedata() is on iframe. before submitting mainform in mainpage i am calling validatedata() function as below. mybool = document.myFrame.validatedata();

This works in IE 6.0 but fails on mozilla firefox.

View 2 Replies View Related

JavaScript And IFRAMES

Jun 20, 2006

I have a webpage with some divs and iframes in them, I have some Javascript code in another page in one of the iframes that when activated, will change the page within the other iframe. The code I have throws the following error:

'null' is null or not an object

and it is complaning abou the following bit of code:

var obj = document.getElementById("frame2");
obj.src = new_src;

But I am not sure if the code is the correct code anyway. Can anyone assist please?
Please find below my complete code, hopefully you can spot what's going on. Here is my 'index.htm' file: Code:

View 2 Replies View Related

Iframes And Javascript

Mar 12, 2002

I'm starting to use some iframes in a div layer. I want to know if i can use javascript to change the size of the iframe (from the parent page containing the iframe).

In IE i can use 100% width and height to fit the iframe to the layer, but in Netscape 6 the iframe doesn't appear if the height is set in % values - hence the need to be able to specify it dynamically as the layer wil change size.

View 1 Replies View Related

Detexting If IFRAMEs Enabled

Dec 1, 2005

Is there a way to use Javascript to detect if a browser supports IFrames, or (if it DOES support them)that IFrame use is enabled?

View 3 Replies View Related

IFRAMEs Show The Same Page

Jan 6, 2006

I am using struts frame work and in one of the jsp pages I have a bunch of IFRAMES like this.(This is in logic iterate and the recordId is incremented with that iteration) ....

View 3 Replies View Related

Iframes And Mouse Position

Sep 22, 2006

I have a really professional conspiracy movie site
and I use tons of layers and an external scroll bar assembly.
I would like to put the various sections into MS Iframes and
in order to clean up the page but I find that the iframes interfere
with the getting the mouse coords from the screen which is
essential in moving the scroll bar around.

My test html is given below. With the iframe hidden the mouse coords
are obtainable. With the iframe visible things get buggy.


Where the "background_foriframe.html" is just a html file with
a background layer using a "DIV" tag. Code:

View 19 Replies View Related

JQuery :: Way To Do Hidden IFrames?

Nov 17, 2011

I have a problem with iframes. In my page there are two iframes, one for loading and one for projects.

Here you can see the problem after clicking on a thumbnail image: [obscured]

My question is: How can I do to hide the second iframeand display it only after the end of loading of first iframe?

I don't have uploaded the code onjsfiddlebecause there doesn't work

View 2 Replies View Related

Resizing Iframes On Click?

Dec 1, 2009

I run a streaming site and am looking to have the option on a chat room next to the stream. Not everyone likes having the chat facility so I'd like to make it optional.

As the page loads I'd like the content to look like the diagram below with the stream (iframe1) taking up 95% of the page and the other 5% being taken up by an image which will say "open chat". The chat (iframe2) would have a width of 0%. [URL]

Then when the "open chat" image is clicked I'd like the chat (iframe2) to become 35% and the stream (iframe1) to become 60%. If someone could make a nice sliding effect when the image is clicked that'd be even better. Here's a diagram to show what it'd look like with the resized iframes. [URL]

View 1 Replies View Related

Using A Form To Control Iframes?

Dec 21, 2009

I basically want to input the url from a form & display it in an iframe, but cant figure out how to link the url from the form to the iframe

The code im using atm

<html>
<head>
<title> SearchLite v2 - search multiple sites at once</title>

[code]....

View 3 Replies View Related

Possible To Add Onclick Events To IFrames?

May 9, 2010

Is it possible to add an onclick event to an iframe or perhaps a DIV that holds an iframe?

In specific I am using the Facebook Open Graph like button code...

What I would like to do is add a simple onclick event to it so that I can run a process when the user clicks on it, at the moment I am just trying alert but cannot get it to work. By setting the iframe within a DIV with height/width specs set would an onclick event work within the DIV?

View 1 Replies View Related

URL For Iframes Not Showing In Address Bar

Dec 30, 2010

I apologise if this is in the wrong section. I have built a website using iframes at: [URL] but when clicking through the menu, the address bar still stays at [URL] no matter which page is loaded into the iframe. I have seen a number of javascripts around that can change this, but most do not seem to work anymore. Has anyone a sure way to correct this please :)

View 8 Replies View Related







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