I have a sharepoint page on which multiple hyperlinks added. due to browser encoding some of them are not redirecting correctly, thus I have to use onclick event for all of them using javascript inline. so while giving hyperlink we can pass URL to inline
onclick function. and then we can use windows.locatoin.href in that function.
In content editor webpart its something like :
<p <a href="javascript:onclick=Myfunction('http://www.bing.com');"> bing</a></p>
<p <a href="javascript:onclick=Myfunction('http://www.yahoo.com');"> google</a></p>
<p <a href="javascript:onclick=Myfunction('http://www.facebook.com');"> facebook</a></p
<script type="text/javascript">
MyFunction(url){
$(document).ready(function(){
window.location.href ='url';
});
}
</script>
I am missing something, can anyone plz help me out.
i have added google, bing and facebook for an example
In content editor webpart its something like :
<p <a href="javascript:onclick=Myfunction('http://www.bing.com');"> bing</a></p>
<p <a href="javascript:onclick=Myfunction('http://www.yahoo.com');"> google</a></p>
<p <a href="javascript:onclick=Myfunction('http://www.facebook.com');"> facebook</a></p
<script type="text/javascript">
MyFunction(url){
$(document).ready(function(){
window.location.href ='url';
});
}
</script>
I am missing something, can anyone plz help me out.
i have added google, bing and facebook for an example