why you need this onclick event at all. If you want the link to fill
the entire div you might be able to just give the anchor display:
block.
On Fri, Feb 27, 2009 at 9:49 AM, introvert <aljaz.fajmut@gmail.com> wrote:
>
> Hello
>
> I have a simple jquery code that will put a link (on click event) on a
> division. The link is read from the anchor inside of the div:
>
> $(document).ready(function() {
> $("div.picture").click(function () {
> var url = $(this).find("a").attr('href');
> window.location = url;
> });
> });
>
> This code will work fine in Firefox and IE, but in Safari it will
> return user to the url:
> http://someurl.com/http://someurl.com
>
> instead of:
> http://someurl.com
>
> How to fix this?
> Any ideas?
>
> Thanks a lot for help!
No comments:
Post a Comment