News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Trying to Add a Javascript

Started by †д∩αỷ ĎάПα, April 22, 2008, 04:36:40 PM

Previous topic - Next topic

†д∩αỷ ĎάПα

I need help in adding javascript in my forum. this is what it will look like after this-



this is the posting page in a forum. I want to add something like this. this is the code I have to add.

1  <html>
     2  <head>
     3  <style>
     4  #ta{
     5  border:2px inset black;
     6  margin:10px;
     7  font-size:2em;
     8  overflow:auto;
     9  width:600px;
    10  height:400px;
    11  }
    12
    13  </style>
    14
    15
    16
    17  <script type="text/javascript" src="/src/js/phoneticunicode.js"></script>
    18  </head>
    19  <body>
    20  <h2>post</h2><br/>
    21  <textarea id="ta">
    22  </textarea>
    23  <script type="text/javascript">
    24  makePhoneticEditor("ta");
    25  </script>
    26  </body>
    27  </html>


I don't get where the head is in SMF. Could anyone tell me?

Thanks

Kindred

the head section is defined for all pages in index.template.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

†д∩αỷ ĎάПα

Could anyone give me a better explaination because there i didn't find </head> where i am supposed to put it

Kindred

 the <head> and </head> are in index.template.php, but you can't just add your code there... because that loads on every single forum page.

There is no "posting page only" head section
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

†д∩αỷ ĎάПα

#4
So where can I put it to load it on post page? Could anyone add it for me please for one file and if I see how you guys did it, I will be able to figure it out by myself. If anyone says yes, i will pm them the post and index file.

thanks

†д∩αỷ ĎάПα

Can I please understand the head section of the index.template.php file? If you please tell me like where the js file's code has to be added, then it would be really easy for me to put. I can put the option button but I can't put the js file to be loaded. is there any way to modify the reply textbox of the smf forum.

Eliana Tamerin

Actually, the Post.template.php page already has some javascript that it loads for that specific page. You could just add yours to that. Just make sure you know where to add the code properly.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

†д∩αỷ ĎάПα

No, I couldn't put it. The problem is that there is no head and when I write it is not in bangla. it is in english.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: