views:

199

answers:

2

Hi,

I would like to gather some ideas how you can implement Javascript in a site that don't allow you to put javascript. Site's I'm talking about are community sites like MySpace, That only allows you to put HTMLs.

some of their implementation I've seen is something like this.

<img src="imagesource" onerror="javascript: find head and write external javascript" />

Now I the code being filtered. any ideas on other implementation?

thanks!

+4  A: 

If they don't allow JavaScript, they probably don't want you to use JavaScript. I don't think trying to work it around is a good idea.

Lukáš Lalinský
..and his name is "Pennf0lio... Penn, you're looking for a teeny weeny thing called "XSS". Also know that most of us *hate* XSS. And that includes me.
Aviral Dasgupta
sorry for that, I also don't support this type of approach. But I was asked by a friend that If I would have create a theme for a myspace and needs to have a dropdown menu, what would I do? how can you write new element and listen to events and etc. thanks!
Pennf0lio
You can do drop down menus without javascript. There exist pure css implementations.
recursive
+1  A: 

If you only want this for drop down menus, it will be easier to implement a javascript free approach, such as this one: http://www.tjkdesign.com/articles/Pure%5FCSS%5FDropdown%5FMenus.asp

Basically, you should lean on the :hover css pseudo-class to do the hard work.

recursive
Cool! this is the perfect solution. Thanks recursive!
Pennf0lio