|
|
|
подключаемые модули javascript
|
|||
|---|---|---|---|
|
#18+
если у меня есть файл stuff.js и я хочу из него обратиться к методам файл extra.js , могу ли я как-то к нему подключиться, не использую *.htm файл? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 09.04.2009, 23:58 |
|
||
|
подключаемые модули javascript
|
|||
|---|---|---|---|
|
#18+
Да. Например я для себя решил проблему так: Tool.js function Include(Path) { var Script=document.createElement('SCRIPT'); Script.src=Path; document.body.appendChild(Script); } Использование: File1.js function Test(){ alert('Test');} File2.html <html> <head> <script language="javascript" type="text/javascript" src='Tool.js'></script> </head> <body> <input type="button" onclick="Include('File1.js')" value="Test Include" /> <input type="button" onclick="Test()" value="Work only if Press Button1 first" /> </body> </html> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.04.2009, 22:43 |
|
||
|
подключаемые модули javascript
|
|||
|---|---|---|---|
|
#18+
RainWork Можно добавить предотвращение повторной загрузки Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.04.2009, 12:59 |
|
||
|
|

start [/forum/topic.php?fid=22&msg=35944071&tid=1454932]: |
0ms |
get settings: |
7ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
154ms |
get topic data: |
8ms |
get forum data: |
2ms |
get page messages: |
28ms |
get tp. blocked users: |
1ms |
| others: | 204ms |
| total: | 419ms |

| 0 / 0 |
