Jump to content
MakeWebGames

Re-code using iframes


Jason-x

Recommended Posts

Hey just wondering has anyone done this with mccodes yet

my index.php layout will be something like + i will have a table wrapped around the main table with a <td align='left'> for the the table in the code, then a <td align='right'> for the dashboard i mention

 

<style>
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
}
</style>
<head>
<html>
<body>
<center>
<table width='1172' height='100%' cellpadding='0' cellspacing='0' border='0'>
<tr height='150' bgcolor='#00FF00'>
<td colspan='2' width='100%'>
<iframe name='header' src='header.php' frameborder='0' height='150' width='100%'></iframe>
</td>
<tr>
<td width='172' valign='top' background='http://puu.sh/5Otp2.png'>
main menu links etc here<br>
<a href='gym.php' target='gamecontent'>Gym</a>
<a href='explore.php' target='gamecontent'>City</a>
<a href='Hospital.php' target='gamecontent'>Hospital</a>
</td>
<td width='1000'>
<iframe name='gamecontent' src='loggedin.php' frameborder='0' height='100%' width='100%'></iframe>
</td>
</tr>
</table>

</body>
</html>
</head>

mail, events, announcements + all the bars (energy will etc) will be in a dashboard at the right hand-side of the page which will call its own refresh every 60 seconds and have a refresh button so players can manually refresh the dashboard to check for messages and such

header.php will contain the games header image + hospital/jail text + all the globals code

main menu will be built around the 2 frames as shown in the snippet of code

then gym and everything will be called into the game content iframe

so if a player types the url gamename.com/gym.php only the gym will display with none of the globals or anything so no one can use the page my typing a direct url

the game will have to be played by the index.php page

just wondering peoples opinions on this and if anyone has done it before with mccodes and how it worked out for them

Edited by Jason-x
Link to comment
Share on other sites

iframes.... IFRAMES!!! For real dude? Iframes are horrible, when they refresh you get a white screen for a second, so distracting. Use a ajax request or something. Please for the love of god don't ever use frames.

Link to comment
Share on other sites

It's possible, but Ajax is better then frames and iframes.

 

- If a user has Javascript enabled, have it use Ajax, much better experience.

- If a user doesn't has Javascript enabled, have the iframe, but add a meta-refresh inside the iframe's content. (Also tell them to turn JS back on)

Link to comment
Share on other sites

iframe site on mobile, the idea alone is nasty!

 

<div style="overflow:auto;-webkit-overflow-scrolling:touch">
    <iframe src="example.com" style="width:100%; height:100%"></iframe>
</div>

 

Everyone assumes everything is so much more complicated than it actually is.

Coder's mindset, I think. Major over-analysis of the simplest of problems.

Link to comment
Share on other sites

<div style="overflow:auto;-webkit-overflow-scrolling:touch">
    <iframe src="example.com" style="width:100%; height:100%"></iframe>
</div>

Everyone assumes everything is so much more complicated than it actually is.

Coder's mindset, I think. Major over-analysis of the simplest of problems.

He didn't say it was complicated, he said the idea of it was nasty.

Personally I use AngularJS to achieve a similar effect ( amongst other things of course ).

Link to comment
Share on other sites

He didn't say it was complicated, he said the idea of it was nasty.

Personally I use AngularJS to achieve a similar effect ( amongst other things of course ).

How is that nasty?

It's the simplest fix there is. Wrap it in a div. Far simpler than any kind of javascript or any kind of extra code of any kind.

Link to comment
Share on other sites

i'm not saying they're no good atall, but using them to layout your site seems to be a bit of a step backward with responsive designs becoming more and more common. Also with the constantly increasing number of people using mobile devices to access the internet, it makes sense to use a method that is going to work 99 times out of 100, rather than risking your site's layout being messed up if the devices mobile browser doesn't support Iframes well (which i think is the case for the mobile chrome and opera browsers)

Don't get me wrong, i'll use them when it's appropriate and they are useful, but in moderation.

Link to comment
Share on other sites

I doubt you would have issues with browsers beside those on mobile devices and even there I'm pretty sure you will have a pretty good support.

IFRAMES can offer some advantages if well used, as well can be a pure pain if badly used (as any tech, even ajax btw). I would therefore not drop it just like that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...