Вы не зашли.
#1.
TLENS
Off
(14)
Moderator
2010.03.09 03:03
Вощем я в JavaScript воще ниче незнаю.
Вот надо вставить get единственное что пришло в голову ето
Код:
| document.writeln('<script src="http://...file.php?'+ |
| location.search.substring(1)+'"></script>'); |
и то неработает.
В общем надо
Код:
| <script src="http://...file.php?СЮДА"></script> |
вставить location.search.substring(1)
Отредактировано TLENS (2010.03.09 03:03)
#3.
TLENS
Off
(14)
Moderator
2010.03.09 12:12
А что html етого не зделает? Надо через html. php здес нельзя юзать.
почему нельзя? динамически ты так скрипт все равно не подгрузишь. браузер загрузит его 1 раз при загрузке страницы.
#5.
TLENS
Off
(14)
Moderator
2010.03.09 14:02
нету поддержки php.
А есть ли другой способ портировать страницу с другого сайта и с вставкой location.search.substring(1)
#6.
TLENS
Off
(14)
Moderator
2010.03.09 14:02
А с помощу document.getElementById можна зделать?
Код:
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| <script type="text/javascript"> |
| window.onload = function () { |
| var js = document.createElement("script"); |
| js.setAttribute("type", "text/javascript"); |
| js.setAttribute("src", "http://somebody.com/script.js?" + location.search.substring(1)); |
| document.body.appendChild(js); |
| } |
| </script> |
| </head> |
| <body> |
| <div>привет, мир</div> |
| </body> |
| </html> |
Добавлено спустя 12 секунд: можно
#8.
TLENS
Off
(14)
Moderator
2010.03.09 21:09
Ссылки не появляются. Там содержимоте типо такого
Отредактировано TLENS (2010.03.09 21:09)
не пользуйся document.write
test.html
Код:
| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| <script type="text/javascript"> |
| window.onload = function () { |
| var js = document.createElement("script"); |
| js.setAttribute("type", "text/javascript"); |
| js.setAttribute("src", "test.js?" + location.search.substring(1)); |
| document.body.appendChild(js); |
| } |
| </script> |
| </head> |
| <body> |
| <div onclick="test();">кликни на меня</div> |
| </body> |
| </html> |
test.js
Код:
| function test () { |
| alert("Молодец"); |
| } |