<script type="text/javascript src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript>
//jquery code
$(function(){ // this will apply this functino to your divs only after the dom has been loaded completely, resolves the issue of code positioning. you can leave it in the head section now
$('.class_of_your_link_divs').click(function(){
var url $(this).attr('id');
window.location = url;
});
});
</script>
<a href="some url" id="hidden-href-1" target="_what you prefer self or blank" class="apply_some_css_to_hide_it">
<div class="i_act_as_a_link" id="href-1" ></div>
$('.i_act_as_a_link').click(function(){
var link = 'hidden'+$(this).attr('id');
$('#'+link).trigger('click');
});
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)
Timestamp: Fri, 21 Dec 2012 13:47:09 UTC
Message: Expected ';'
Line: 3
Char: 15
Code: 0
URI: http://mydomainname.com/js/activefunctions.js
$(function(){
$('.divlinkopen').click(function(){
var url $(this).attr('id');
window.location = url;
});
});
$(function(){
$('.divlinkopen').click(function(){
var url = $(this).attr('id');
window.location = url;
});
});
<script type="text/javascript src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript" >
$(function(){
$('.clicker').click(function(){
window.open($(this).data('url'));
});
});
</script>
<div id="homepageMain">
<div class="left"></div>
<div id="clicker" data-url="http://www.microsoft.com" class="right"></div>
</div>
$('.clicker').click(function(){
window.location = $(this).data('url');
});
Try:
Open in new window