Page 1 of 1

A quick question

Posted: Fri Aug 31, 2012 7:29 pm
by supersonictt
Am building another extension, this time I need to add a script before the end of the body tag, can this be done in EB4?
Thanks.

Re: A quick question

Posted: Fri Aug 31, 2012 8:21 pm
by BaconFries
It can be done but it requires that you manipulate the body html by using DOM/javascript. I think our javascript wizard [RZ] has a fix for this as another forum member had a similar issue (Adendum) but I stand to be corrected if wrong on this. [Rz] may read this and be able to assit you with this.

Re: A quick question

Posted: Fri Aug 31, 2012 10:37 pm
by supersonictt
Thank you so much BaconFries.

Actually I can notify users of the extension to include the code in the end of the body tag, but I always try to make as easy as possible for users.

Re: A quick question

Posted: Sat Sep 01, 2012 10:27 pm
by [RZ]
oh yes... i'm [rz]... responding from my own javascript oracle... i'm hearing my little children invoking the esoteric power from the dom mystery... i won't reveal my deepest secret... never... but i have a half of mercy on you... because you are trying to learn the ancestral secret... you must still wait a couple of years... anyhow, my simplest solution is... enclose your <script></script> into a <div></div> with the highest possible z-index value... this way you will have this code by the </body> tag... this isn't the most orthodox solution... the dom gates are closed now...


well, in honor of the truth, to manipulate the dom you must know "intimately" what the whole project does, and how other jquery/javascript procedures work and how can them be affected, otherwise you will be running into a series of severe/unpredictable issues. this is one of the reasons i always write my own code for the extensions, remember i told you this?
hope this little trick helps! (in most of the cases it will work fine and an extensive experience is not required.)

@bacon, thank you for your concept about me!
@supersonictt, as per your reply to bacon it seems you actually prefer to notify users... so you are free to ignore my post ;)

Re: A quick question

Posted: Sat Sep 01, 2012 10:53 pm
by supersonictt
[RZ] wrote:@supersonictt, as per your reply to bacon it seems you actually prefer to notify users... so you are free to ignore my post ;)
Hehe, no [rz] am not gonna ignore from you! You are like a teacher to me :) and I learned from you a lot :)
Thank you so much for the suggestion, I will give it a try :)

Re: A quick question

Posted: Sat Sep 01, 2012 11:03 pm
by [RZ]
saywhat!? you said i'm a true teacher and now you say just "like" a teacher!?
no no no...

Re: A quick question

Posted: Sat Sep 01, 2012 11:16 pm
by supersonictt
Sorry master :oops:

You can read here what's written :)
viewtopic.php?f=42&t=50159&p=253038#p253038

Re: A quick question

Posted: Sat Sep 01, 2012 11:20 pm
by [RZ]
i haven't read this. ok, no problem now!
(just kidding)

Re: A quick question

Posted: Sat Sep 01, 2012 11:22 pm
by supersonictt
Hehe :D