Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Печать iframe / 3 сообщений из 3, страница 1 из 1
04.10.2008, 17:20
    #35576301
rufatina
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Печать iframe
Собственно сабж . У меня есть страница в котором есть iframe.Хочу расспечатать тока то что внутри iframe В Mozilla Firefox все работает , а с IE берет и печатает всю страницу.

Вот код :

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" language="JavaScript1.2" src="/Conf/Print.js"></script>
        <title>JSP Page</title>
    </head>
    <body>

   <iframe name="nese" src="jsph/Barcod.jsp"></iframe>
    <input type="button" value="Print BarCode" onclick="nese.print()"/> 
</body>
</html>
...
Рейтинг: 0 / 0
04.10.2008, 18:55
    #35576363
Ex_Soft
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Печать iframe
тынць

_________________
"Helo, word!" - 17 errors 56 warnings
Posted via ActualForum NNTP Server 1.4
...
Рейтинг: 0 / 0
06.10.2008, 10:08
    #35577336
rufatina
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Печать iframe
Решил проблему Вот решение Может кому то понадобится

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL  1 . 1  library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <title>JSP Page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">
function PrintIframe()
{
frames["nese"].focus();
frames["nese"].print();
}
</script>
        

   </head>
    <body>
    
   <iframe name="nese" src="jsph/Barcod.jsp"></iframe>
    <input type="button" value="Print BarCode" onclick="PrintIframe()"/> 
    </body>
</html>
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
<script type="text/javascript">
function PrintIframe()
{
frames["nese"].focus();
frames["nese"].print();
}
</script>
Просто добавьте этот код Все гениальное просто
...
Рейтинг: 0 / 0
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Печать iframe / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]