Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm generating a string with php for onclick event of an html button with an output like this:
HTML
<button class="ChooseButton" id="168" onclick="LoadTheme(['#993300', '#99CC99', '#003366', '#993300', '#99CC99'])">Choose</button>


When this button is clicked, corresponding function gets an array of colors and assigns them to some html elements.
Is this a secure code with those parameters?
Posted
Comments
Richard MacCutchan 21-Feb-15 13:13pm    
In what way do you mean "secure"?
Solai Raja 24-Feb-15 6:24am    
There no such a secure information, so you do this.

1 solution

By design, JavaScript is secure like hell, unless someone use such a dirty thing as embedded ActiveX components which spoil it all. However, how care if someone changes the colors on some page, even if it could make it completely unreadable (red font on red background)? What can it possibly destroy? Nothing, really.

—SA
 
Share this answer
 
Comments
cs101000 21-Feb-15 14:30pm    
Well I'm not too much familiar with the ways of attacking or exploits and etc. What I mean is that someone can abuse this to do something that I don't ever expect to be possible(other than calling this js function and changing colors, of course).
Sergey Alexandrovich Kryukov 21-Feb-15 20:32pm    
If you think about it, you will understand that nobody care is someone abuses it this way. :-)
—SA
Kuthuparakkal 21-Feb-15 16:02pm    
:)
cs101000 22-Feb-15 2:07am    
:D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900