vForums Support :: Programming & Coding :: Programming Discussion :: View Topic - <Script> tags allowed? |  |
| Darkmage Senior Member
    I believe in vForums, and YOU should too!
Avi Updating Posts: 1,808 Status: Offline Gender: Male Location: In the Shadows. Age: 18 Joined: 25th Nov 2007
| <Script> tags allowed? (24th Oct 08 at 10:00pm) Info Center? | | Are Script tags allowed in the "Manage Forum Templates" area?
Because I made this: (Yeah I know this kind of script, because I know what I am working with >_>)
 Code: - <script>
- /*
- Count up script-
- By Infinity Codes (http://icodes.vforums.co.uk)
- */
-
- var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
-
- function countup(yr,m,d){
- var today=new Date()
- var todayy=today.getYear()
- if (todayy < 1000)
- todayy+=1900
- var todaym=today.getMonth()
- var todayd=today.getDate()
- var todaystring=montharray[todaym]+" "+todayd+", "+todayy
- var paststring=montharray[m-1]+" "+d+", "+yr
- var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1)
- difference+=" days"
- document.write("It\'s been "+difference+" since the launch of Infinity Codes!")
- }
- //enter the count up date using the format year/month/day
- countup(2008,3,23)
- </script>
-
It works in the header/footer area, just not in the custom info center area?
Darkmageq | | Back to Top - Link to Post |


|
| VeaZna Junior Member
 
![[Avatar]](http://a.deviantart.com/avatars/v/e/veazna.gif) "Pickle Weasil" Posts: 78 Status: Offline Location: Guess... Joined: 2nd Oct 2008
| | Re: <Script> tags allowed? (25th Oct 08 at 3:30am) | | the Templates are HTML coding
this is javascript | | Back to Top - Link to Post |
  |
| Darkmage Senior Member
    I believe in vForums, and YOU should too!
Avi Updating Posts: 1,808 Status: Offline Gender: Male Location: In the Shadows. Age: 18 Joined: 25th Nov 2007
| | Re: <Script> tags allowed? (25th Oct 08 at 5:24am) | | | I know. But for some reason, Stat Counter script codes work in the Info Center, but this code wont. | | Back to Top - Link to Post |


|
| Ross Administrator
     They say I can't speel 
![[Avatar]](http://images.virtualforums.co.uk/homepage/av.jpg) Yes, speel was a deliberate misstake... Posts: 2,515 Status: Offline Gender: Male Location: Surrey, UK Age: 20 Joined: 13th Jun 2006
Additional Groups: Support Team
| | Re: <Script> tags allowed? (27th Oct 08 at 10:31am) | | Yes, you can use Javascript in templates. However there is currently 1 big limitation. The templates work by first stripping out any new lines as they interfere with some tags. This means that any Javascript entered also has its line breaks removed. This is only a problem if you've used either <!-- at the start and //--> at the end or a comment using a double forward slash, eg. //enter the count up date using the format year/month/day However using /* comment */ comments will work fine: /* enter the count up date using the format year/month/day */ | | Back to Top - Link to Post |
 |
| Darkmage Senior Member
    I believe in vForums, and YOU should too!
Avi Updating Posts: 1,808 Status: Offline Gender: Male Location: In the Shadows. Age: 18 Joined: 25th Nov 2007
| | Re: <Script> tags allowed? (27th Oct 08 at 10:20pm) | | Alright thanks.
So spaces
you mean like the one above?
Then why does this one work:
 Code: - <!-- Start of StatCounter Code -->
- <script type="text/javascript">
- var sc_project=4149254;
- var sc_invisible=0;
- var sc_partition=51;
- var sc_click_stat=1;
- var sc_security="4cbd58cd";
- </script>
-
- <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><div class="statcounter"><a title="site stats" href="http://www.statcounter.com/free_web_stats.html" target="_blank"><img class="statcounter" src="http://c.statcounter.com/4149254/0/4cbd58cd/0/" alt="site stats" ></a></div></noscript>
- <!-- End of StatCounter Code -->
And thanks.
When I make a new Info Center I will be adding the new code in. | | Back to Top - Link to Post |


|
| Dwight Senior Member
   
![[Avatar]](http://i25.photobucket.com/albums/c51/dog199200/Naruto/RockLeeAvi.gif) Mess with the best, die like the rest. Posts: 1,056 Status: Offline Gender: Male Location: Behind You Age: 16 Joined: 21st Jan 2008
| | Re: <Script> tags allowed? (27th Oct 08 at 11:56pm) | | | it works because the comments are on the outside of the code and not the side of it | | Back to Top - Link to Post | Big Coding Project 40% Done


 |
| Darkmage Senior Member
    I believe in vForums, and YOU should too!
Avi Updating Posts: 1,808 Status: Offline Gender: Male Location: In the Shadows. Age: 18 Joined: 25th Nov 2007
| | |
 |  |
|