Javascript and MySpace/Facebook etc.

Question: I post a lot on Myspace.com and I have tried to add a few features to my profile to make it unique, one of those features was a counter to keep track of how many people come and go. Unfortunately MySpace.com does not allow Javascript, only HTML/DHTML and CSS. I have the Javascript for the counter and I would like to know how to convert the Javascript into HTML or CSS code.
Amber

Answer: HTML CSS and Javascript are three completely different things. You can convert from one programming language to another or from one markup language to another but you can't convert a program into markup. It would be something like trying to convert your TV into a refrigerator.

The only way in which you might possibly be able to attach JavaScript into a page on a site that doesn't allow JavaScript is if the site allows you to put small amounts of JavaScript into event handlers embedded into the HTML and if you have some web hosting elsewhere to put the actual JavaScript file. Provided you can place some code in an onload event handler in the body tag you can add JavaScript to the page by using that event handler to add the script tag into the page.

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate