/    Sign up×
Community /Pin to ProfileBookmark

Help with iframes in jscript.

Hi,

im using the following code to display my XBL (Xbox Live) gamercard on my website.

[code]
function gamercard() {
// shortcut reference to the document object
d = document;

// if the modalContainer object already exists in the DOM, bail out.
if(d.getElementById(“div”)) return;

// create the modalContainer div as a child of the BODY element
divObj = d.getElementsByTagName(“body”)[0].appendChild(d.createElement(“div”));
divObj.id = “modalContainer”;

iframeObj = divObj.appendChild(d.createElement(“iframe”));
iframeObj.id = “gamertag”;

//set properties for iframe
iframeObj.allowtransparency = “true”;
iframeObj.scrolling = “no”;
iframeObj.frameBorder = “0”;
iframeObj.height = “140”;
iframeObj.width = “204”;
iframeObj.marginwidth = “0”;
iframeObj.marginheight = “0”;

//set the source of the iframe
iframeObj.src = “http://gamercard.xbox.com/Oracle%20Of%20All.card”;
}
[/code]

unfortunatley the following commands will not work in MSIE:
iframeObj.scrolling = “no”;
iframeObj.frameBorder = “0”;

does anyone know how i can get around this??

To see an example visit [url]www.gamershq.com.au[/url] and click on My Gamercard below the login form on the right.

help is greatly appreciated

/– Oracle Of All

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gphNov 06.2005 — try it this way

<i>
</i> iframeObj = d.createElement("iframe");
iframeObj.src = "http://gamercard.xbox.com/Oracle%20Of%20All.card";
iframeObj.id = "gamertag";
iframeObj.allowtransparency = "true";
iframeObj.scrolling = "no";
iframeObj.frameBorder = 0;
iframeObj.height = "140";
iframeObj.width = "204";
iframeObj.marginwidth = "0";
iframeObj.marginheight = "0";
divObj.appendChild(iframeObj);
Copy linkTweet thisAlerts:
@oracle_of_allauthorNov 06.2005 — Thankyou heaps it works perfectly now, i owe you.
×

Success!

Help @oracle_of_all spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...