How to simulate anchor link click
If you use jQuery and the native DOM, the anchor can be clicked
// insert an <a> into document and click it **natively**// (.get(0) returns the DOM element)$('<a id="fred99" />').attr('href', '#david').attr('target', '_blank').text('LINK').appendTo('body').get(0).click();// now we've clicked, tidy up$('#fred99').remove();
Looks like your $("google_link_proxy")
selector is off. Try $("#google_link_proxy")
.
You also need to close the observe call with })
.
Those are the syntax errors with the code above though I don't think those functions are provided in jQuery by default.
Here is what I think you're after:
$("#google_link_proxy").click(function(event){ window.open($("#google_link").attr('href'),'_blank')});