iFrame Difficulties

somavian

New Member
Messages
7
Reaction score
0
Points
0
I have an iFrame setup and it works fine with local pages, but not any external pages. Is there a feature blocking that on x10hosting? I didn't think it was against the terms of service, but am I wrong?
 

somavian

New Member
Messages
7
Reaction score
0
Points
0
var query = document.location.search.substring(1);
var params = query.split('&');
var url = params[0].split('=');
alert(url);
document.write('<iframe id="displayFrame" frameborder="0" width="' + (screen.availWidth - 34) + '" height="' + GetHeight() + '" src=' + url[1] + '></iframe>');

The alert prints the url properly (http:\\www.google.com for example) and again, it works with internal pages (like index.php).
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
To answer the main question, no, there is no feature blocking iframe content unless you put it there yourself (bust-out code, referer-based .htaccess restrictions, that sort of thing).

You may, however, be running into difficulties with relative URLs or same-source restrictions in the browser. As descalzo pointed out, a URL or code to look at would be nice. (Preferably both, since many of the sorts of problems that can arise can't really be spotted by viewing the page source, and it helps to see if your code is actually resolving to the values you expect in the browser.)
 

descalzo

Grim Squeaker
Community Support
Messages
9,375
Reaction score
327
Points
83
Try it with a different external URL. Pretty sure that Google does not want to be put in iframes and has code to blank itself out if you try.
 

somavian

New Member
Messages
7
Reaction score
0
Points
0
You're right again, thanks. I had tried a few and none of them liked it, but I finally got smart enough to try another one of my sites and that worked.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
To add to the other comments about including code, proper sample code (complete, concise, representative) should accompany every development question. See the links in my sig for more guidelines.

Please use
PHP:
, [html] or [code] tags (as appropriate) to separate and format code.
 
Top