views:

577

answers:

4

I need to open a page inside another page without the horizontal scroll bar in the inner page.

I don't want to use <iframe> tags on my page. Is there any substitute to the <iframe> tag??

A: 

Maybe <object> or <embed> or something like that. I think you can put an html there. But that would be sort of the same, i guess...

Victor
Sort of the same — just less well supported and less flexible.
David Dorward
Yes, I agree to David...
Manish
+1  A: 

Best way to avoid IFRAME is to use AJAX. If you would use jQuery it is as simple as that:

$('#yourDIV').load('http://someurl.com/example.html');

Where #yourDIV is ID of any element you want, DIV for example.

Thinker
How is this better than <iframe>?
_simon_
I wouldn't call a dependency on JavaScript the best way to get rid of iframes, and certainly not without context. We don't know if the same origin policy would cause a problem. We don't know if the goal is "Have scrollbars inside the page" rather than "Load content from another document".
David Dorward
+3  A: 

If this is about the scrollbars (you mentioned that in your comment), you can hide/show them using stylesheets - try the following:

<body style="overflow-y:hidden; overflow-x:hidden">
...
</body>

You can use the styles on other tags (textareas etc.) as well.

PS: If you clarify your question, it's a good idea to edit the original post instead of commenting - this will make it easier to understand your question.

wilth
About editing the original post- Thanks, will keep in mind..
Manish
A: 

If you want to validate against strict, <object> should be the way to go.

<object data="example.html" type="text/html" width="500" height="300"></object>

Please note that MSIE 6 doesn't support html object tags.

ZJR