What I want is a hyperlink More when clicked on runs some javascript function and also changes to a hyperlink Less. Heres what I have which doesnt work. It runs the ajaxpage function fine but not moreToLess. I think its my use of ‘ and ‘ in the javascript.
<script type='text/javascript'> function moreToLess(){ document.getElementById('tagLinks').innerHTML = '<a href=# OnClick='ajaxpage('/TagCloud?id=EDI_0009&count=20', 'tagcloud');lessToMore()' >Less</a>'; } function lessToMore(){ document.getElementById('tagLinks').innerHTML = '<a href=# OnClick='ajaxpage('/TagCloud?id=EDI_0009&count=50', 'tagcloud');moreToLess()' >More</a>'; } </script> <span id=tagLinks ><a href=# OnClick='ajaxpage('/TagCloud?id=EDI_0009&count=50', 'tagcloud');moreToLess()' >More</a></span>
Yes it is, just escape your single quotes inside of the double quotes that you have in your javascript.. ala \’