Модераторы: Sardar, Aliance
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Кеширование части html 
:(
    Опции темы
Elfet
  Дата 31.1.2007, 14:51 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Белый и Пушистый
****


Профиль
Группа: Awaiting Authorisation
Сообщений: 3776
Регистрация: 2.4.2003

Репутация: нет
Всего: 16



Я пишу wysiwyg редактор для своего сайта и хочу что бы такие куски кода из редактора, как палитра, кэшировались. Как такое сделать?  smile 


--------------------
PM MAIL WWW Skype   Вверх
sergejzr
Дата 31.1.2007, 14:52 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Un salsero
Group Icon


Профиль
Группа: Админ
Сообщений: 13285
Регистрация: 10.2.2004
Где: Германия г .Ганновер

Репутация: 10
Всего: 360



Разбить скрипт на части и каждую часть в свой js файл. Нужные части подгружать.


--------------------
PM WWW IM ICQ Skype GTalk Jabber AOL YIM MSN   Вверх
Elfet
Дата 1.2.2007, 09:52 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Белый и Пушистый
****


Профиль
Группа: Awaiting Authorisation
Сообщений: 3776
Регистрация: 2.4.2003

Репутация: нет
Всего: 16



А как html разбить в js файл? Вот я пишу wysiwyg редактор:
Код

<link type="text/css" rel="stylesheet" href="files/Editor.css">
<script language="JavaScript" type="text/javascript" src="files/Menu.js"></script>
<div id="Editor1" class="EditorWrapper">
<table class="EditorTable" border="0">
    <tr>
        <td>
            <table id="EditorToolBar" class="EditorMenu" border="0">
                <tr>
                    <td><div id="Bold" class="EditorButton"><img src="files/Bold.gif" alt="" /></div></td>
                    <td><div id="Italic" class="EditorButton"><img src="files/Italic.gif" alt="" /></div></td>      
                    <td><div id="Underline" class="EditorButton"><img src="files/Underline.gif" alt="" /></div></td> 
                    <td><img src="files/toolbar.gif" alt="" /></td>
                    <td><div id="Link" class="EditorButton"><img src="files/Link.gif" alt="" /></div></td>                                 
                    <td><div id="Unlink" class="EditorButton"><img src="files/Unlink.gif" alt="" /></div></td>
                    <td><img src="files/toolbar.gif" alt="" /></td>
                    <td><div id="Image" class="EditorButton"><img src="files/Image.gif" alt="" /></div></td>                    
                    <td style="display:none;" class="EditorNullClassToHide"><img src="files/toolbar.gif" alt="" /></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="Outdent" class="EditorButton"><img src="files/Outdent.gif" alt="" /></div></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="Indent" class="EditorButton"><img src="files/Indent.gif" alt="" /></div></td>
                    <td style="display:none;" class="EditorNullClassToHide"><img src="files/toolbar.gif" alt="" /></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="justifyleft" class="EditorButton"><img src="files/justifyleft.gif" alt="" /></div></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="justifycenter" class="EditorButton"><img src="files/justifycenter.gif" alt="" /></div></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="justifyright" class="EditorButton"><img src="files/justifyright.gif" alt="" /></div></td>
                    <td style="display:none;" class="EditorNullClassToHide"><img src="files/toolbar.gif" alt="" /></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="Forecolor" class="EditorButton" onclick="EditorShowPalette('EditorSoure', this)"><img src="files/ForeColor.gif" alt="" /><img src="files/arrowIcon.gif" alt="" /></div></td>   
                    <td style="display:none;" class="EditorNullClassToHide"><div id="Backcolor" class="EditorButton" onclick="EditorShowPalette('EditorSoure', this)"><img src="files/BackColor.gif" alt="" /><img src="files/arrowIcon.gif" alt="" /></div></td>   
                    <td style="display:none;" class="EditorNullClassToHide"><img src="files/toolbar.gif" alt="" /></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="Font" class="EditorDropdown" onclick="EditorShowFont('EditorSoure', 'FontName', this)" style="width:120px;"> <span id="FontName">Шрифт</span> <img src="files/arrowDropdown.gif" alt="" /></div></td> 
                    <td style="display:none;" class="EditorNullClassToHide"><div id="Size" class="EditorDropdown" onclick="EditorShowSize('EditorSoure', 'SizeName', this)" style="width:100px;"> <span id="SizeName">Размер</span> <img src="files/arrowDropdown.gif" alt="" /></div></td>                     
                    <td style="display:none;" class="EditorNullClassToHide"><img src="files/toolbar.gif" alt="" /></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="Undo" class="EditorButton"><img src="files/Undo.gif" alt="" /></div></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="Redo" class="EditorButton"><img src="files/Redo.gif" alt="" /></div></td>      
                    <td style="display:none;" class="EditorNullClassToHide"><img src="files/toolbar.gif" alt="" /></td>
                    <td style="display:none;" class="EditorNullClassToHide"><div id="FormatStripper" class="EditorButton"><img src="files/FormatStripper.gif" alt="" /></div></td>   
                    <td><img src="files/toolbar.gif" alt="" /></td>
                    <td><div id="Collapse" class="EditorButton" onclick="EditorCollapse('EditorSoure', this, 800, 600, 400, 150)"><img src="files/Collapse.gif" alt="" /></div></td>                 
                </tr>
            </table>            
        </td>
    </tr>
    <tr>
        <td id="EditorSoure" style="width: 400px; height: 150px;" class="EditorBody">
        <textarea style="width: 100%; height: 100%;" class="EditorTextarea">Hello World!</textarea>
        </td>
    </tr>
    <tr>
        <td>
            <table class="EditorMenu" border="0">
                <tr>
                    <td><div id="CheckDesign" class="EditorButtonCheck"><img src="files/ButtonDesign.gif" alt="" /> Редактирование</div></td>
                    <td><div id="CheckHtml" class="EditorButton"><img src="files/ButtonHtml.gif" alt="" /> Источник</div></td>    
                </tr>
            </table>         
        </td>
    </tr>
</table>
</div>
<script language="JavaScript" type="text/javascript">
<!--
EditorSetHover('Bold');
EditorSetHover('Italic');
EditorSetHover('Underline');
EditorSetHover('Link');
EditorSetHover('Unlink');
EditorSetHover('Image');
EditorSetHover('Outdent');
EditorSetHover('Indent');
EditorSetHover('justifyleft');
EditorSetHover('justifycenter');
EditorSetHover('justifyright');
EditorSetHover('Forecolor');
EditorSetHover('Backcolor');
EditorSetHover('Undo');
EditorSetHover('Redo');
EditorSetHover('FormatStripper');
EditorSetHover('CheckDesign');
EditorSetHover('CheckHtml');
//-->
</script>

<div id="EditorPalette" style="display:none;" class="EditorDrop">
<table id="EditorTablePalette" class="EditorTablePalette" border="0">
    <tr>
        <td id="#FFFFFF" style="background-color:#ffffff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFCCCC" style="background-color:#ffcccc; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFCC99" style="background-color:#ffcc99; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFFF99" style="background-color:#ffff99; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFFFCC" style="background-color:#ffffcc; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#99FF99" style="background-color:#99ff99; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#99FFFF" style="background-color:#99ffff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#CCFFFF" style="background-color:#ccffff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#CCCCFF" style="background-color:#ccccff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFCCFF" style="background-color:#ffccff; height:10; width:10" ><img height="1" width="1"/></td>
    </tr>
    <tr>

        <td id="#CCCCCC" style="background-color:#cccccc; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FF6666" style="background-color:#ff6666; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FF9966" style="background-color:#ff9966; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFFF66" style="background-color:#ffff66; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFFF33" style="background-color:#ffff33; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#66FF99" style="background-color:#66ff99; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#33FFFF" style="background-color:#33ffff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#66FFFF" style="background-color:#66ffff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#9999FF" style="background-color:#9999ff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FF99FF" style="background-color:#ff99ff; height:10; width:10" ><img height="1" width="1"/></td>
    </tr>
    <tr>
        <td id="#C0C0C0" style="background-color:#c0c0c0; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FF0000" style="background-color:#ff0000; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FF9900" style="background-color:#ff9900; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFCC66" style="background-color:#ffcc66; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFFF00" style="background-color:#ffff00; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#33FF33" style="background-color:#33ff33; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#66CCCC" style="background-color:#66cccc; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#33CCFF" style="background-color:#33ccff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#6666CC" style="background-color:#6666cc; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#CC66CC" style="background-color:#cc66cc; height:10; width:10" ><img height="1" width="1"/></td>
    </tr>
    <tr>
        <td id="#999999" style="background-color:#999999; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#CC0000" style="background-color:#cc0000; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FF6600" style="background-color:#ff6600; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFCC33" style="background-color:#ffcc33; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#FFCC00" style="background-color:#ffcc00; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#33CC00" style="background-color:#33cc00; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#00CCCC" style="background-color:#00cccc; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#3366FF" style="background-color:#3366ff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#6633FF" style="background-color:#6633ff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#CC33CC" style="background-color:#cc33cc; height:10; width:10" ><img height="1" width="1"/></td>
    </tr>
    <tr>

        <td id="#666666" style="background-color:#666666; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#990000" style="background-color:#990000; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#CC6600" style="background-color:#cc6600; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#CC9933" style="background-color:#cc9933; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#999900" style="background-color:#999900; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#009900" style="background-color:#009900; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#339999" style="background-color:#339999; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#3333FF" style="background-color:#3333ff; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#6600CC" style="background-color:#6600cc; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#993399" style="background-color:#993399; height:10; width:10" ><img height="1" width="1"/></td>
    </tr>
    <tr>
        <td id="#333333" style="background-color:#333333; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#660000" style="background-color:#660000; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#993300" style="background-color:#993300; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#996633" style="background-color:#996633; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#666600" style="background-color:#666600; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#006600" style="background-color:#006600; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#336666" style="background-color:#336666; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#000099" style="background-color:#000099; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#333399" style="background-color:#333399; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#663366" style="background-color:#663366; height:10; width:10" ><img height="1" width="1"/></td>
    </tr>
    <tr>
        <td id="#000000" style="background-color:#000000; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#330000" style="background-color:#330000; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#663300" style="background-color:#663300; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#663333" style="background-color:#663333; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#333300" style="background-color:#333300; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#003300" style="background-color:#003300; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#003333" style="background-color:#003333; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#000066" style="background-color:#000066; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#330099" style="background-color:#330099; height:10; width:10" ><img height="1" width="1"/></td>
        <td id="#330033" style="background-color:#330033; height:10; width:10" ><img height="1" width="1"/></td>
    </tr>
    <tr>
        <td id="#000000" colspan="8" >По умолчанию</td>
        <td id="EditorPaletteDefault" colspan="8" style="background-color:#330033; height:10; width:20" ><img height="1" width="1"/></td>
    </tr>    
</table>
</div>
<div id="EditorFont" style="display:none;" class="EditorDrop">
<table id="EditorTableFont" class="EditorTableFont" border="0">
        <tr><td id="Arial" style="font-family:Arial;" class="EditorTableFont">Arial</td>
        <tr><td id="Courier New" style="font-family:Courier New;"  class="EditorTableFont">Courier New</td></tr>
        <tr><td id="Georgia" style="font-family:Georgia;"  class="EditorTableFont">Georgia</td></tr>
        <tr><td id="Impact" style="font-family:Impact;"  class="EditorTableFont">Impact</td></tr>
        <tr><td id="Microsoft Sans Serif" style="font-family:Microsoft Sans Serif;"  class="EditorTableFont">Microsoft Sans Serif</td></tr>
        <tr><td id="Verdana" style="font-family:Verdana;"  class="EditorTableFont">Verdana</td></tr>
        <tr><td id="Times New Roman" style="font-family:Times New Roman;"  class="EditorTableFont">Times New Roman</td></tr>
        <tr><td id="Tahoma" style="font-family:Tahoma;" class="EditorTableFont">По умолчанию</td></tr>
</table>
</div>
<div id="EditorSize" style="display:none;" class="EditorDrop">
<table id="EditorTableSize" class="EditorTableFont" border="0">
        <tr><td id="19px" class="EditorTableFont">Самый крупный</td>
        <tr><td id="15px" class="EditorTableFont">Крупный</td></tr>
        <tr><td id="11px" class="EditorTableFont">Нормальный</td></tr>
        <tr><td id="7px" class="EditorTableFont">Мелкий</td></tr>
        <tr><td id="3px" class="EditorTableFont">Самый мелкий</td></tr>
</table>
</div>
<script language="JavaScript" type="text/javascript">
<!--
EditorInitColorPalette();
EditorInitFont();
EditorInitSize();
//-->
</script>

Достаточно большой код. Я хочу его убрать в файл и вставлять в страницу примерно вот так:
Код

<script language="JavaScript" type="text/javascript">
<!--
EditorInit('editor1');
//-->
</script>

 smile 


--------------------
PM MAIL WWW Skype   Вверх
pythonwin
Дата 1.2.2007, 14:14 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Участник
Сообщений: 2529
Регистрация: 18.4.2006
Где: за компом

Репутация: 1
Всего: 36



Elfet, фомируй таблицу(ы) в JS из xml или из json, хотя можно и без AJAX - просто создай массив и из него создавай таблицу - код будет меньше smile

Это сообщение отредактировал(а) pythonwin - 1.2.2007, 14:15
PM WWW GTalk Jabber   Вверх
Elfet
Дата 1.2.2007, 21:15 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Белый и Пушистый
****


Профиль
Группа: Awaiting Authorisation
Сообщений: 3776
Регистрация: 2.4.2003

Репутация: нет
Всего: 16



Несовсем понял как  smile 
Полностью таблицу описывать в JS? Мне это не очень удобно. Такую весчь и редактировать сложно. Есть ещё способы?  smile  


--------------------
PM MAIL WWW Skype   Вверх
sergejzr
Дата 2.2.2007, 00:53 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Un salsero
Group Icon


Профиль
Группа: Админ
Сообщений: 13285
Регистрация: 10.2.2004
Где: Германия г .Ганновер

Репутация: 10
Всего: 360



Код

document.write("<table><tr><td>калбаса</td></tr></table>");



--------------------
PM WWW IM ICQ Skype GTalk Jabber AOL YIM MSN   Вверх
Elfet
Дата 2.2.2007, 09:25 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Белый и Пушистый
****


Профиль
Группа: Awaiting Authorisation
Сообщений: 3776
Регистрация: 2.4.2003

Репутация: нет
Всего: 16



Вот так вот? smile  smile 


--------------------
PM MAIL WWW Skype   Вверх
pythonwin
Дата 2.2.2007, 11:04 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Участник
Сообщений: 2529
Регистрация: 18.4.2006
Где: за компом

Репутация: 1
Всего: 36



sergejzr, не так smile

Код

<div id="EditorSize" style="display:none;" class="EditorDrop">
<table id="EditorTableSize" class="EditorTableFont" border="0">
        <tr><td id="19px" class="EditorTableFont">Самый крупный</td>
        <tr><td id="15px" class="EditorTableFont">Крупный</td></tr>
        <tr><td id="11px" class="EditorTableFont">Нормальный</td></tr>
        <tr><td id="7px" class="EditorTableFont">Мелкий</td></tr>
        <tr><td id="3px" class="EditorTableFont">Самый мелкий</td></tr>
</table>
</div>


можно переделать в 
Код

l = Array([{"19px"}, "Самый крупный"],["15px", "Крупный"],["11px", "Нормальный"],["7px", "Мелкий"],["3px", "Самый мелкий"])
l1=[]
l1=Array()
for (i=0; i<l.length; i++){
l1[i]=TR(null, TD({'id':l[i][0], 'class':"EditorTableFont"}, l[i][1]))
}
d1 = DIV({'id':"EditorSize", 'style':"display:block;", 'class':"EditorDrop"}, TABLE({'id':"EditorTableSize", 'class':"EditorTableFont", 'border':"0"}, l1))

хотя это лучше для больших таблиц smile
PM WWW GTalk Jabber   Вверх
Elfet
Дата 2.2.2007, 14:16 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Белый и Пушистый
****


Профиль
Группа: Awaiting Authorisation
Сообщений: 3776
Регистрация: 2.4.2003

Репутация: нет
Всего: 16



pythonwin, уажс! Дмауешь это так нжуно?


--------------------
PM MAIL WWW Skype   Вверх
pythonwin
Дата 2.2.2007, 14:28 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Участник
Сообщений: 2529
Регистрация: 18.4.2006
Где: за компом

Репутация: 1
Всего: 36



Цитата(Elfet @  2.2.2007,  17:16 Найти цитируемый пост)
pythonwin, уажс! Дмауешь это так нжуно? 

1) удобная работа с html как с классами, но на более высоком уровне чем DOM
2) можно легко организовать AJAX и совместить его с кодом
3) приведенный мною код сильно упрощён - можно применять функции типа map и т.д., что сильно сокращает код - можно разбить на функции
4) код дан для маленькой таблицы для простоты понимания
5) прошу, простить за питоновский стиль кода

Добавлено @ 14:31 
6) у меня в коде предполагается, что 
Код

l = Array([{"19px"}, "Самый крупный"],["15px", "Крупный"],["11px", "Нормальный"],["7px", "Мелкий"],["3px", "Самый мелкий"])

загружается через AJAX либо как xml, либо как json
PM WWW GTalk Jabber   Вверх
Elfet
Дата 2.2.2007, 15:48 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Белый и Пушистый
****


Профиль
Группа: Awaiting Authorisation
Сообщений: 3776
Регистрация: 2.4.2003

Репутация: нет
Всего: 16



А если мне тут совсем не нужна работа с AJAX? Я же хочу закешировать (см. сабж) Не хочу вставлять этот код в саму страницу. 


--------------------
PM MAIL WWW Skype   Вверх
pythonwin
Дата 2.2.2007, 15:57 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Участник
Сообщений: 2529
Регистрация: 18.4.2006
Где: за компом

Репутация: 1
Всего: 36



Цитата(Elfet @  2.2.2007,  18:48 Найти цитируемый пост)
А если мне тут совсем не нужна работа с AJAX? Я же хочу закешировать (см. сабж) Не хочу вставлять этот код в саму страницу.  

просто таблицы перепиши в JS и создание таблицы сделай через Object - потом запиши в js-файл

работать с таблицей (добавление/удаление ячеек) легкое smile

PM WWW GTalk Jabber   Вверх
sergejzr
Дата 2.2.2007, 15:57 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Un salsero
Group Icon


Профиль
Группа: Админ
Сообщений: 13285
Регистрация: 10.2.2004
Где: Германия г .Ганновер

Репутация: 10
Всего: 360



Elfet, млин, тебе уже кучу способов предложили. Чего ты ждёшь ещё? smile


--------------------
PM WWW IM ICQ Skype GTalk Jabber AOL YIM MSN   Вверх
pythonwin
Дата 2.2.2007, 16:03 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
****


Профиль
Группа: Участник
Сообщений: 2529
Регистрация: 18.4.2006
Где: за компом

Репутация: 1
Всего: 36



Цитата(sergejzr @  2.2.2007,  03:53 Найти цитируемый пост)
document.write("<table><tr><td>калбаса</td></tr></table>");

хотя можно и через свойство innerHTML

Код

ob1.innerHTML="<table><tr><td>калбаса</td></tr></table>"


где ob1 - это тег через DOM

Добавлено @ 16:08 
есть ещё способ в js-файл вынеси переменную 
Код

str1="<table><tr><td>калбаса</td></tr></table>"


а в самом html
Код

<script>
ob1.innerHTML=str1;
</script>


Это сообщение отредактировал(а) pythonwin - 2.2.2007, 16:09
PM WWW GTalk Jabber   Вверх
Elfet
Дата 12.2.2007, 11:25 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Белый и Пушистый
****


Профиль
Группа: Awaiting Authorisation
Сообщений: 3776
Регистрация: 2.4.2003

Репутация: нет
Всего: 16



Всем спасибо smile Я в document.write запихал всё


--------------------
PM MAIL WWW Skype   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Форум для вопросов, которые имеются в справочниках, но их поиск вызвал затруднения, или для разработчика требуется совет или просьба отыскать ошибку. Напоминаем: 1) чётко формулируйте вопрос, 2) приведите пример того, что уже сделано, 3) укажите явно, нужен работающий пример или подсказка о том, где найти информацию.
 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | JavaScript: Общие вопросы | Следующая тема »


 




[ Время генерации скрипта: 0.0681 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.