Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If not iframe then how ?

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
I have an iframe which I have found Opera does not handle properly.

I am racking my brians how to change this to a single page and it still function the same way.

I can easily use AJAX to get each new document and update the DOM, however doing this stretches the page as some statements are "2 pages" long, you have to understand the statement is created out of SAGE as HTML and there isn't much I can do with it.

ok I know I could place a control on the DIV tag to force only a certain size and add scrollbars for overflow, thus looking and feeling like the iframe worked.

However, how would I print a specific DIV that's content was in an overflow with scroll bars.

IE, the statement needs to print on two pages like it normaly would.

Also SAGE places a whole load of CSS and other formating as it creates it as a full HTML document with a head, body etc..

How would I parse the document and extract the data I need to place in the DIV tag.

It's not a problem in an iframe, as it is a correct and full HTML page.

Is this possible?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
However, how would I print a specific DIV that's content was in an overflow with scroll bars.
No worries, you define a print stylesheet that changes the DIV to have overflow:visible

Define a print stylesheet last (so it over rides previous declarations) and set it to use media="print":
Code:
<link rel="stylesheet" type="text/css" href="print.css" media="print" />

How would I parse the document and extract the data I need to place in the DIV tag.
Maybe you won't have to. Have a look at the print stylesheet (use print preview to mimic it) and use the overflow:auto (and set the width/height of the DIV) and then redefine it in the print.css.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
I have an iframe which I have found Opera does not handle properly.

Can you define this further? What does Opera do that it should not (or not do that it should)? Maybe there is a workaround that will let you keep your iframes.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
cool, do i also need to set top/left margins somehow, as you probably know i have a menu to the left for selecting the statement, ok I know I can place that in a DIV and hide it via the print CSS, but does that automatically move everything to top left that is visible when it is printed.

Also I have a major problem getting this to display properly.

here are two screen shots, (i've blanked out the sensative data)



both have the same "Source Code", the one that displays correctly is opened as a single page in a new browser. the bad is the same code placed in the DIV tag via the AJAX request.

why is this happening and what can I do to solve it?

the css in the code is ...
Code:
<style type="text/css">
			BODY	{ font-family:Verdana,sans-serif; font-size:x-small; vertical-align:top; }
 			DIV	{ overflow: visible; }
			H1	{ font-family:Verdana,sans-serif; font-size:12pt; font-weight:bold; text-decoration:underline; margin-bottom:0%; margin-top:0%}
			H2	{ font-family:Verdana,sans-serif; font-size:x-small; font-weight:bold; text-decoration:underline; margin-bottom:0%; margin-top:0%}
			.txt1	{ font-weight:bold; text-decoration:underline; }
			.txt2	{ text-decoration:underline; }
		</style>

thanks 1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
the problem in Opera is no matter that I do the ifram is always "On Top" so the menu to the left is hidden behind the iframe.

i've tried z-index till i'm blue in the face placing everything else in div tags with higher and lower z-indexs but no good nothing will make opera show the ifram BEHIND the actual main page content.

i like the iframe option over anyother - it's easier to deal with and solves many problems , the printing one for a start and the current font size problem.

hmmm this has taken alot of my time and loads of re-coding just to try to make it work in Opera..... i'm sure i've got less hair now than when i started.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
BillyRayPreachersSon (Programmer) 8 Dec 05 5:44

You'll need to ensure that the code placed via AJAX is actually the correct code. Alert it, and make sure it is right.

the code placed is exactly the same as the code if viewed in a seperate browser, because it's the same PERL program called which suplies the output.

via ajax i call it and capture the return HTML and update the DOM, if you call it on it's own via a normal URL it is simply printed to the screen.

can you use a style tag anywhere in the HTML, is that the problem, because the style is part of the returned data and placed in the div via the AJAX method?

but the returned code although displaying corectly in a browser on it's own doesn't have any head, html or body tags, i'm going to add the style to the main CSS for the page and see if it makes a difference.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
because the style is part of the returned data and placed in the div via the AJAX method?
Why do you do that? Do you need the style to change when the data is streamed back? If not, then the AJAX call should only be updating the data, not the look of the page.



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Why do you do that?
I don't - I have no control over what is outputed from SAGE, it's a remittance advise using the option "Save As HTML". the task i need to do is take the output and display it. The iframe method, sweet as nut, everything works like a dream.


The problem comes with this Opera issue, so how do i take the HTML page and have it display correctly when used as the data for the DIV tag inner.HTML.

which is why i was leaning towards the idea of some how parsing the data, i already do some editing by opening the HTML file and doing PERL s/find/change/i; hence being able to remove the HEAD BODY HTML tags, the data as it is returned is fine apart from the style for the H1 & H2 classes.

i've just added the classes to the main css file and now i can control the fonts, so i guess if i use PERL to delete style which SAGE creates in the output, i'm back on track

I just need to add the over flow to the div tag and get the page back to normal size and then work on the print CSS.

I'll let you know how i get on

regards,
1DMF


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Ok I've get everything working fine except I can't get the PRINT css to work.

I've started a new thread thread215-1162601 any ideas what I can do.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top