PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → How to... modify <BODY> tag?
How to... modify <BODY> tag?
Débuté par Yaroslav Alpizar, 25 fév. 2008 14:01 - 4 réponses
Posté le 25 février 2008 - 14:01
Hello everyone... I'm trying to add the following line to the body tago f a page:

<script SRC="/user/res/wz_tooltip.js"></script>

But cannot find how to modify the body tag of the html page...need help ASP...thanks!
Posté le 25 février 2008 - 16:31
Sorry for posting twice...
Posté le 25 février 2008 - 16:48
Hi Yaroslav

In the advanced tab of the page description, you can define external JS
files... You can also add html code directly, but int hat case, it
shouldn't be necessary

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


Yaroslav Alpizar wrote:
Hello everyone... I'm trying to add the following line to the body tago f a page:

<script SRC="/user/res/wz_tooltip.js"></script>

But cannot find how to modify the body tag of the html page...need help ASP...thanks!
Posté le 26 février 2008 - 11:46
Thanks Fabrice...but I've already tried that. In the advance tab you can add html code to the HEADER and not to the BODY or at least is what I understand from what I've tested. I'm trying to change the BODY dinamically using a jscript function like this one:

function Change_body(){
var script = document.createElement('script');
script.src = 'wz_tooltip.js';
script.defer = true;
var body = document.getElementsByTagName('BODY');
body.appendChild(script);
}

But I got this error when executing: "Object does not accept this method or property"

I guess that appendchild(script) does not works with body but according to MSDN the body object accepts this method. I tried also with insertAdjacentElement and insertbefore but same answers...

In the end I just want to show a tooltip when moving the mouse over an image and show some specific data. Any tip to do this?

Thanks again...
Posté le 26 février 2008 - 12:00
Problem solved! Some small corrections on the jscript function:

function Change_body(){
var myscript = document.createElement('script');
myscript.src= 'wz_tooltip.js';
document.body.appendChild(myscript);
}

Thanks!