Greetings.
I encountered this little problem and am stuck. I don't know what should I google. I am developing a webpage with Coldfusion and I need to use some Javascript also.
I have a component, and onclick of that component, I would like to call a Javascript function and pass in some arguments - the arguments are gotten from some Coldfusion variables. I have made the function to run, but at the time of coding, I did not thought of this problem. So here it a little snippet.
<!-- html -->
<input type="button" value="Click me" onClick="sortTable(0, 'abcdef')">
<script>
function sortTable(arg1){
if(sortTable.arguments.length > 1)
alert(sortTable.arguments[1]);
}
</script>
The above code is just something similar to my program. That snippet works. But, if I pass in arguments[1] as 'this is hm's program' then the program fails. That is because of the ' symbol there. The error says, "expected )". I can't figure out what should I do to escape that.
Please advise.